Camera Movement

TheLionKing 101 Aug 20, 2003 at 11:38


For moving cameras in the screen, we can either use

  • gluLookat() or
  • glRotatef(), glTranslatef()

glRotatef() and glTransoatef() are used to move the pointer on the screen. (I think)

gluLookat() takes in 9 parameters however, and it is also said that it can be use beside the above two.

  • What is the real difference between them?
  • Which gives the best result what we want?
  • What do the professionals use for moving the camera in their games :blush: ?

7 Replies

Please log in or register to post a reply.

davepermen 101 Aug 20, 2003 at 12:43

i use LookAt for the camera placement, and Rotate/Translate(/Scale,MultMatrix) for positioning the objects..

on how to use them, use google, and you get the helpfiles.. or even in your favourite MSDN library, eighter in visual studio integrated, or online..

TheLionKing 101 Aug 21, 2003 at 03:10

So you mean that we can use both or any one of them to accomplish the same task.

Both perform the same work … right :wtf: ?

dk 158 Aug 21, 2003 at 08:23

Well, both could give the same visual effect, but mathematically, they are completly different. I’d recommend using gluLookAt for camera, and glTranslatef/glRotatef for objects. i.e. don’t mix them up. It’s just more logical. I mean, don’t use glTranslatef when, in actual fact, you mean moving the camera for example.

TheLionKing 101 Aug 21, 2003 at 12:26

So (if I am not wrong :blush: ) you mean :

  • gluLookAt() is used to move the camera around the objects
  • While glTranslatef() & glRotatef() are used to move the objects around the camera

I think I am right … :blush:

donBerto 101 Aug 21, 2003 at 14:57

yes that’s right. but it’s more like this: gluLookAt opens a window at the position you have specified [to look into]. but there is no actual camera object.

as far as gluLookAt being enough for your project, it is. but if you wanna have some fun, try making a camera class.


rogerdv 101 Aug 21, 2003 at 15:05

After reading this topic I modified my code to use gluLookAt. I discovered huge mistakes and some things i havent managed to achieve now looks easier.
So I have to say that not using gluLookat is the most stupid mistake you can make.

TheLionKing 101 Aug 21, 2003 at 15:49

:yes: Thanks guys … I have got the picture clearly moving aroung my eyes.

Thanks … :D !