Jump to content


Camera Movement


7 replies to this topic

#1 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 20 August 2003 - 11: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: ?

<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>

#2 davepermen

    Senior Member

  • Members
  • PipPipPipPip
  • 1306 posts

Posted 20 August 2003 - 12:43 PM

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..
davepermen.net
-Loving a Person is having the wish to see this Person happy, no matter what that means to yourself.
-No matter what it means to myself....

#3 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 21 August 2003 - 03:10 AM

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: ?
<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>

#4 Dia

    DevMaster Staff

  • Administrators
  • 1120 posts

Posted 21 August 2003 - 08: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.

#5 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 21 August 2003 - 12:26 PM

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:
<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>

#6 donBerto

    Senior Member

  • Members
  • PipPipPipPip
  • 369 posts

Posted 21 August 2003 - 02:57 PM

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:
Imagine.

#7 rogerdv

    Member

  • Members
  • PipPip
  • 99 posts

Posted 21 August 2003 - 03:05 PM

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.

#8 TheLionKing

    Valued Member

  • Members
  • PipPipPip
  • 143 posts

Posted 21 August 2003 - 03:49 PM

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

Thanks ... :D !
<span style='color:blue'>I can survive anything ... even NUKES!!!
The Lion King</span>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users