I am unaware of SFML containing any rotational capabilities, and I would not depend on them if they do, as there are three different kinds of rotations, as such, I wrote my own rotational code, which you can be free to use:
void Being3D::PlusMatrix(sf::Vector3<float> XMatrix, sf::Vector3<float> YMatrix, sf::Vector3<float> ZMatrix){
sf::Vector3<float> XMtransform(MultiplyByMatrix(_XMatrix, XMatrix, YMatrix, ZMatrix));
sf::Vector3<float> YMtransform(MultiplyByMatrix(_YMatrix, XMatrix, YMatrix, ZMatrix));
sf::Vector3<float> ZMtransform(MultiplyByMatrix(_ZMatrix, XMatrix, YMatrix, ZMatrix));
_XMatrix = XMtransform;
_YMatrix = YMtransform;
_ZMatrix = ZMtransform;
std::vector<Being3D*> c = _Children;
for (unsigned int i=1; i < c.size();i++){
c[i]->PlusMatrix(XMatrix, YMatrix, ZMatrix);
}
}
void Being3D::ToMatrix(sf::Vector3<float> XMatrix, sf::Vector3<float> YMatrix, sf::Vector3<float> ZMatrix){
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//TODO: MAKE MORE EFFICIENT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
sf::Vector3<float> InverseMatrix[3];
CoFactor(InverseMatrix, _XMatrix, _YMatrix, _ZMatrix);
Transpose(InverseMatrix);
PlusMatrix(InverseMatrix[0], InverseMatrix[1], InverseMatrix[2]);
PlusMatrix(XMatrix, YMatrix, ZMatrix);
}
////////////////////
////////////////////
// rotation //
////////////////////
////////////////////
void Being3D::GlobalRotateX(float rotx){
float cosx = cos(rotx);
float sinx = sin(rotx);
sf::Vector3<float> YMatrix(0,cosx,sinx);
sf::Vector3<float> ZMatrix(0,-sinx,cosx);
PlusMatrix(sf::Vector3<float> (1,0,0), YMatrix, ZMatrix);
}
void Being3D::GlobalRotateY(float roty){
float cosy = cos(roty);
float siny = sin(roty);
sf::Vector3<float> XMatrix(cosy,0,-siny);
sf::Vector3<float> ZMatrix(siny,0,cosy);
PlusMatrix(XMatrix, sf::Vector3<float> (0,1,0), ZMatrix);
}
void Being3D::GlobalRotateZ(float rotz){
float cosz = cos(rotz);
float sinz = sin(rotz);
sf::Vector3<float> XMatrix(cosz,sinz,0);
sf::Vector3<float> YMatrix(-sinz,cosz,0);
PlusMatrix(XMatrix, YMatrix, sf::Vector3<float> (0,0,1));
}
void Being3D::RotateX(float rotx){
float cosx = cos(rotx);
float sinx = sin(rotx);
sf::Vector3<float> XMatrix (MultiplyByMatrix(sf::Vector3<float> (1,0,0), _XMatrix, _YMatrix, _ZMatrix));
sf::Vector3<float> YMatrix (MultiplyByMatrix(sf::Vector3<float> (0,cosx,sinx), _XMatrix, _YMatrix, _ZMatrix));
sf::Vector3<float> ZMatrix (MultiplyByMatrix(sf::Vector3<float> (0,-sinx,cosx), _XMatrix, _YMatrix, _ZMatrix));
ToMatrix(XMatrix, YMatrix, ZMatrix);
}
void Being3D::RotateY(float roty){
float cosy = cos(roty);
float siny = sin(roty);
sf::Vector3<float> XMatrix (MultiplyByMatrix(sf::Vector3<float> (cosy,0,-siny), _XMatrix, _YMatrix, _ZMatrix));
sf::Vector3<float> YMatrix (MultiplyByMatrix(sf::Vector3<float> (0,1,0), _XMatrix, _YMatrix, _ZMatrix));
sf::Vector3<float> ZMatrix (MultiplyByMatrix(sf::Vector3<float> (siny,0,cosy), _XMatrix, _YMatrix, _ZMatrix));
ToMatrix(XMatrix, YMatrix, ZMatrix);
}
void Being3D::RotateZ(float rotz){
float cosz = cos(rotz);
float sinz = sin(rotz);
sf::Vector3<float> XMatrix (MultiplyByMatrix(sf::Vector3<float> (cosz,sinz,0), _XMatrix, _YMatrix, _ZMatrix));
sf::Vector3<float> YMatrix (MultiplyByMatrix(sf::Vector3<float> (-sinz,cosz,0), _XMatrix, _YMatrix, _ZMatrix));
sf::Vector3<float> ZMatrix (MultiplyByMatrix(sf::Vector3<float> (0,0,1), _XMatrix, _YMatrix, _ZMatrix));
ToMatrix(XMatrix, YMatrix, ZMatrix);
}