lsdi
12-31-2001, 06:14 PM
I wrote this to make a 6DF game, but something its wrong:
- I CANT PITCH MORE THEM 90º
- THE ROLL ITS NOT SMOOTH - ITS LIKE WAVES
- I DONT KNOW TO MOVE IN THE CAMERAS DIRECTION
Can Anyone help me or tell me where I found more info?
here is the code:
ps. sorry for bad english.
struct Camera
{
float x, y, z;
float yaw, pitch, roll;
} cam;
float tx, ty, tz=0.0f;
float rx, ry, rz=0.0f;
void mundo(void)
{
tx=cam.x+cos(cam.yaw)*0.5;
ty=cam.y+sin(cam.pitch)*0.5;
tz=cam.z+sin(cam.yaw)*0.5;
rx=sin(cam.roll)*0.5;
ry=cos(cam.roll)*0.5;
rz=0.0f;
glPushMatrix();
gluLookAt(cam.x,cam.y,cam.z,
tx,ty,tz,
rx,ry,rz);
glCallList(Lground);
glPopMatrix();
}
- I CANT PITCH MORE THEM 90º
- THE ROLL ITS NOT SMOOTH - ITS LIKE WAVES
- I DONT KNOW TO MOVE IN THE CAMERAS DIRECTION
Can Anyone help me or tell me where I found more info?
here is the code:
ps. sorry for bad english.
struct Camera
{
float x, y, z;
float yaw, pitch, roll;
} cam;
float tx, ty, tz=0.0f;
float rx, ry, rz=0.0f;
void mundo(void)
{
tx=cam.x+cos(cam.yaw)*0.5;
ty=cam.y+sin(cam.pitch)*0.5;
tz=cam.z+sin(cam.yaw)*0.5;
rx=sin(cam.roll)*0.5;
ry=cos(cam.roll)*0.5;
rz=0.0f;
glPushMatrix();
gluLookAt(cam.x,cam.y,cam.z,
tx,ty,tz,
rx,ry,rz);
glCallList(Lground);
glPopMatrix();
}