>> <Newbie alert>
>> I am reading the redbook and have some confusion regarding the viewing
>> and modeling transformation.
> There is a "duality" between modeling and viewing transformations. Suppose
> you want to draw a ball. Translating the "camera" -10 units in Z before
> you draw the ball has the same effect as translating the ball 10 units in
> Z and leaving the camera alone. They both occur on the modelview matrix.
> Whether the camera or ball moves is all in how you think about it.
> If you want to think in terms of moving the "camera" or "view", those
> transformations come first.
First of all thanks to all who replied (Fungus, Marcus and DM)
Yes DM, it is just 'beginning' to sink in now.
You mentioned here that 'moving the camera transformations come first' and I
get that part. This means moving the objects transformation come next.
Suppose I have a series of transformations and I am *not* using gluLookAt()
I am pretty sure the first translation will move the "camera". What will the
second one do? Will it push the camera further or will it get the object
nearer to the camera? Do I need to specify the matrixmode(modelview) in
between these two to specify that the second translation should affect the
object? Reading chapter 3 made me believe that modelview is used for both
camera and object. So I am getting confused how should i explicitely say
'hey, this command is to move the camera' 'this command is to move the
Quote:> Then you move, rotate, scale, the objects in
> your model or scene. All of those transformations are performed relative
> to where you placed the "camera" or "view".
got that. but how is openGL to know that I done moving/rotating my camera
and now further commands will affect the position and orientation of the
object when all I have is one object. what will be the psudocode for
//orient object 1
//draw object 1
//orient object 2
//draw object 2
//move camera to look at these two from some other place
//orient object 3
//draw object 3
Thanks a lot for your time people. Really appreciate it.
Quote:> Read chapter 3 of the Red Book until it sinks in. It takes a while when
> you're a beginner. ;-) Also, read up on the gluLookAt() function. It's the
> closest thing in OpenGL to a true "camera". It should be covered in
> chapter 3 as well.
am in the second pass. :)