GX Camera Issues
Posted: Wed Jun 22, 2011 5:33 am
Im trying to make a FPS type view in GX and iv got it working except for 1 small problem. Im trying to rotate the camera:
Basicly it just takes an angle, calculates a y chord for the view vector and loads it into the view matrix (m). This works perfectly except for when you go all the way up or down. I think this is because im not updating the Up vector. Would i just inverse the slope of the line between the view point and camera location and add/subtract it to the up vector? Much help would be appreciated. And also, i have one last question: I've tried to use translations and rotations on the view matrix but they seem to have no effect. Are you not able to use the regular transformation functions on view matrices?
Thanks
mv2112
Code: Select all
angle2+=d;//New Viewing angle
float y=cam[0].y+sin(DegToRad(angle2)); //Get New Y From the New View Angle and add it to the cameras position
cam[2].y=y; //set the View Y to the generated Y ^^ //guVector cam[3]
guMtxIdentity(m);
guLookAt(m, &cam[0], &cam[1], &cam[2]); //reload camera
Thanks
mv2112