I have a sphere - it's actually a map of the world and I want to be able to rotate 360 around it (imagine going around the equator, hence X axis and Z axis)... for this I am using:
Code: Select all
campos.X = sin(deg_rads(m_cameraAngleX)) * m_cameraRadius;
campos.Z = cos(deg_rads(m_cameraAngleX)) * m_cameraRadius;
Now comes the prob.. I also want limited up and down movement... i'm going to limit this to above 45 degrees up and 45 degrees down, so I wont be worrying about gimbel lock... hence i thought i wouldnt need quaternions.
I thought i could somehow do the following and then combine the campos.Z data as this is needed for both rotation types with: (this is both rotations)
Code: Select all
campos.X = sin(deg_rads(m_cameraAngleX)) * m_cameraRadius;
campos.Y = sin(deg_rads(m_cameraAngleY)) * m_cameraRadius;
campos.Z = cos(deg_rads(m_cameraAngleX)) * m_cameraRadius;
campos.Z += sin(deg_rads(m_cameraAngleY)) * m_cameraRadius;
Many thanks in advance....