Woorld coordinates system?
Lets say i make a class in one of nehe''s first examples (lets take the spinning cubes and pyramids). This class would keep the position of one of these objects in a vector (x,y,z). I would want it to be possible to move it like object.pos = (100, 59, 73) or something like that.
So my question is, how would i make one of these world coordinates system?
to move your object/camera in GL, see glTranslate function.. to rotate it, glRotate..
I am not very sure if it is what you ask though.. hope that helps..
I am not very sure if it is what you ask though.. hope that helps..
I know i can move it that way, but i dont WANT to move it that way. I want to be able to change the x y and z coordinates of an object and it moves
As mentat said, you can use the OpenGL function glTranslate to move the object and glRotate to rotate and object... look into that.
Dave "Dak Lozar" Loeser
Dave "Dak Lozar" Loeser
Im guessing that you want to move the cube (or whatever) in the world so that it doesnt need to be further transformed by the world transform.
all this means is that you apply the transformations to the actual verticies to make the transformations permanent, rather than a once off.
for example when we use glTranslate or some such function, we set a matrix so that each vert added to the render pipeline has that transformation applied to it.
what you want to do is transform each of the verts in memory.
really bad explanation, sorry.
for example... (lets say we have an array of verts called Verts
- set up a transform matrix. (glTranslate etc)
- Verts = Verts * transform <br>or the multiplication may need to be the other way around.<br><br>sorry i cant explain it better, but i need to go.<br><br>later<br>Marc<br><br><br><br> </i>
all this means is that you apply the transformations to the actual verticies to make the transformations permanent, rather than a once off.
for example when we use glTranslate or some such function, we set a matrix so that each vert added to the render pipeline has that transformation applied to it.
what you want to do is transform each of the verts in memory.
really bad explanation, sorry.
for example... (lets say we have an array of verts called Verts
- set up a transform matrix. (glTranslate etc)
- Verts = Verts * transform <br>or the multiplication may need to be the other way around.<br><br>sorry i cant explain it better, but i need to go.<br><br>later<br>Marc<br><br><br><br> </i>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement