Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CVector3D::Rotate(double rotx, double roty, double rotz)
- {
- CVector3D result(x, y, z);
- if (rotx)
- {
- result.y += (double)(y*cos(rotx) - z*sin(rotx));
- result.z += (double)(y*sin(rotx) + z*cos(rotx));
- }
- if (roty)
- {
- result.x += (double)(x*cos(roty) + z*sin(roty));
- result.z += (double)(- x*sin(roty) + z*cos(roty));
- }
- if (rotz)
- {
- result.x += (double)(x*cos(rotz) - y*sin(rotz));
- result.y += (double)(x*sin(rotz) + y*cos(rotz));
- }
- *this = result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement