Object Rotation and Position
Hi.
I''m trying to rotate and set position of an object in my 3d world.
After creating to simple triangles within vertexbuffer and setting up world, view and translation matrices, I want one triangle to move and rotate.
How can I realise this?
Thank you
Plato
The purpose of the world matrix is to transform your object from model space to world space. Changing the matrix changes the orientation of the object. So, to move an object, apply a translation matrix to the world. To rotate it, apply a rotation matrix.
I like pie.
I like pie.
Thank you...
But when I apply those Matrices whole World transforms and rotates?!
How do i apply a matrix to an object??
Plato
But when I apply those Matrices whole World transforms and rotates?!
How do i apply a matrix to an object??
Plato
1: Set the transform for the object you want to draw.
2: Draw it.
3: goto 1 while DrawableObjectsLeft
The transforms only affect the things you draw after setting them.
Alright thank you!
Im doing like this now:
-Reading currentWorldTransformation into tmp
-Tranlate and Rotate my Object into p_objMatrix
-SetWorldTransform(p_objMatrix)
-Draw Object
-SetWorldTransform(tmp)
Is this correct?
[edited by - Plato on August 8, 2003 6:23:07 AM]
Im doing like this now:
-Reading currentWorldTransformation into tmp
-Tranlate and Rotate my Object into p_objMatrix
-SetWorldTransform(p_objMatrix)
-Draw Object
-SetWorldTransform(tmp)
Is this correct?
[edited by - Plato on August 8, 2003 6:23:07 AM]
Somewhat, yes.
However, you shouldn''t have to ''read'' the temp matrix from everywhere (video card).
Instead, you should already have the global world transformation established when starting rendering.
Read up on ''matrix stacks'', i dont remember any links though...
Nik
However, you shouldn''t have to ''read'' the temp matrix from everywhere (video card).
Instead, you should already have the global world transformation established when starting rendering.
Read up on ''matrix stacks'', i dont remember any links though...
Nik
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement