I want to rotate a Vector(0, -10, 0) around the X and Y axis. I want to rotate X rotX
degrees(0 - 360°) and Y rotY
degrees(0 - 180°). I tried much but I couldnt get it done. Coudld anybody give me a solution for that? Some of my code I tried:
LightRotX = -posX;
LightRotY = -10 * cos((rotY) * PI / 180.0) - posZ * sin((rotY) * PI / 180.0);
LightRotZ = -10 * sin((rotY) * PI / 180.0) + posZ * cos((rotY) * PI / 180.0);
float bZ = LightRotZ;
float bX = LightRotX;
LightRotX = bZ * sin((rotX) * PI / 180.0) + bX * cos((rotX) * PI / 180.0);
LightRotZ = bZ * cos((rotX) * PI / 180.0) - bX * sin((rotX) * PI / 180.0);