Hi
i need to make a 3d vector from point 0,0,0 to a specific point in space that is defined by pitch,yaw angles and distance.
somehow i manage to find proper yaw vector (green one) (see images below)
but i really really dont have an idea how to find make pitch vector and then how do i make a one vector
the thing is when pitch angle is greater than lets say 10 degrees lines are inaccurate (white and red ones)
oh and that white something that pretends to be a sphere is the point we want to face)
Y shows the pitch angle x shows yaw angle
100000000.0 is distance, imopi converts degrees to radians
kag.x = -100000000.0f*(sin(yawangle*imopi));
kag.z = -100000000.0f*(cos(yawangle*imopi));
kag.y = -100000000.0f*(sin(pitchangle*imopi));
glBegin(GL_LINES);
glColor3f(0,1,0);
glVertex3f(0,0,0);
glVertex3f(kag.x,0,kag.z);
glColor3f(1,0,0);
glVertex3f(0,0,0);
glVertex3f(kag.x*cos(pitchangle*imopi),kag.y,kag.z*cos(pitchangle*imopi));
glColor3f(1,1,1);
glVertex3f(0,0,0);
glVertex3f(kag.x,kag.y,kag.z);
glEnd();
yaw can be from 0 to 360
pitch is from 0..180 but i manage it differently (lets say it is -90..90)