PDA

View Full Version : newbie question: camera isn't facing correctly?



12-25-2003, 08:37 AM
I have a grid of 8 x 8 quads on the screen, I logged the values of x and y for each of my quads[i][j] structure to ensure they were correct, which they are, but when I actually run the program, they seem to be all on top of each other. I think that the problem is actually that my camera isn't facing the correct "side". The quads just form a line, but because of the depth, I can see the edges of the back quads behind the front quads. How would I take my camera and alter its position so that it faced correctly? (I'm guessing taking the camera, moving it diagonally across and then turning it 90 degrees would do it, but I'm not sure how to do that.)
All help is appreciated.
Jake
AIM: solacedagony
ICQ: 14260031

Rog
12-26-2003, 08:35 AM
Use glLookAt(). This is an easier way of entering glTranslate() and glRotate() calls to get what you want. You supply an (x,y,z) for the camera position, an (x,y,z) of the direction (i.e. any point that it's looking at), and another (x,y,z) to define the up-vector (normally 0,1,0) which shows which way is skyward.