View Full Version : Camera Movement
TheLionKing
08-20-2003, 05:38 AM
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: ?
davepermen
08-20-2003, 06:43 AM
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
08-20-2003, 09:10 PM
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: ?
Dia Kharrat
08-21-2003, 02:23 AM
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
08-21-2003, 06:26 AM
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
08-21-2003, 08:57 AM
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:
rogerdv
08-21-2003, 09:05 AM
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
08-21-2003, 09:49 AM
:yes: Thanks guys ... I have got the picture clearly moving aroung my eyes.
Thanks ... :D !
vBulletin, Copyright ©2000-2009, Jelsoft Enterprises Ltd.