RE: Camera Movement.

"William Woodbury" <[email protected]> Tue, 28 Mar 2006 05:34:29 -0800
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
I'll assume that you want to know how to perform the inverse transformation
to put the world into camera local space, and that you are using C/C++ (I
think OpenGL ES is only for C/C++?):
if you have two triplets, one the camera translation (CameraTranslation[]),
the other the cameras euler rotation (CameraRotation[]), then you can get
into camera local space like so:

// set viewport and projection matrix here

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glRotatef(-CameraRotation[0], 1.0f, 0.0f, 0.0f);
glRotatef(-CameraRotation[1], 0.0f, 1.0f, 0.0f);
glRotatef(-CameraRotation[2], 0.0f, 0.0f, 1.0f);
glTranslatef(-CameraTranslation[0], -CameraTranslation[1], -CameraTranslatio
n[2]);

// do drawing of objects here

Its common to create a class for handling camera functions so that to get
the above you just have to call Camera.SetAsCurrent(), or something similar.

  -----Original Message-----
  From: [email protected] [mailto:[email protected]]On Behalf Of
Ajit Singh
  Sent: 28 March 2006 12:34
  To: Multiple recipients of list OPENGL-GAMEDEV-L
  Subject: Camera Movement.


  Hello Friends,



  I’m new to OpenGL and I want to develop a Mobile Game using OpenGL ES for
Brew platform.



  Right now I’m stuck with camera movement in OpenGL ES.

  As it is clear that there is on such thing like Camera, it is been
implement by transforming the world in the inverse direction.

  I’m following the same above concept.



  Please help in the same.

  Any Help Appreciated.


  --
  This message has been scanned for viruses and
  dangerous content by and is believed to be clean.