Camera Movement

40da7e74fdca33768b6714646853b3f5
0
TheLionKing 101 Aug 20, 2003 at 11:38

Hi,

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.

6ad5f8c742f1e8ec61000e2b0900fc76
0
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..

40da7e74fdca33768b6714646853b3f5
0
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: ?

Fdbdc4176840d77fe6a8deca457595ab
0
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.

40da7e74fdca33768b6714646853b3f5
0
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:

C24eb7e6aaefba78b94c831ddc7b4d0b
0
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.

:yes:

9275cef0ad2f15ec1813d63b0c5b0fad
0
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.

40da7e74fdca33768b6714646853b3f5
0
TheLionKing 101 Aug 21, 2003 at 15:49

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

Thanks … :D !