Re: [cgkit-user] specifiying the new location of an opengl "object" using quaternion
Brought to you by:
mbaas
From: Matthias B. <mat...@gm...> - 2010-09-19 17:03:32
|
On 14.09.10 21:05, Roland Everaert wrote: > cameraMat = mat4.translation(vec3(0.0, -3.0, -10.0)) > [...] > redShipMat = mat4.translation(vec3(5.0, 0.0, -10.0)) > redShipMat = redShipMat * cameraMat > [...] > glLoadMatrixf(cameraMat.toList()) > # Rendering of the player ship > > glLoadMatrixf(redShipMat.toList()) Why are you applying the camera to the transformation of the red ship manually and why are you using glLoadMatrix() instead of glMultMatrix() to set the ship's transformation? Usually, you set the view transformation at the beginning and then you don't have to worry about the camera anymore. Everything else is described in the world coordinate system. I think it would really be beneficial if you could get hold of some OpenGL book or a book about writing 3D games that explains all the basic concepts in more detail than can be done on this list. You may also get more information from a forum/list that is actually dedicated to generic OpenGL rendering. Cheers, - Matthias - |