• Advertisement
Sign in to follow this  

Permanent Object Transformation . . . . ..

This topic is 3046 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hy, is there any way to translate or rotate a 3D object permanently without loading identity matrices again and again. Like, i have a cube and i want to rotate the cube itself but not the modelview matrix. The solution i think is that i have to create a matrix for each vertex of the cube and then load that vertex matrix and then use rotation or translation method, this way cube will rotate but not the modelview matrix, but i maybe wrong. Will be greatly thankful if someone can help out. Regards.

Share this post


Link to post
Share on other sites
Advertisement
That means i have to convert every point into a matrix?
Wont that be difficult and time consuming?
Does OpenGL provide any function which takes in x, y, z and returns matrix or something?

Share this post


Link to post
Share on other sites
no, multiply each point by the transformation matrix you wish, then store the results.

Share this post


Link to post
Share on other sites
I know what your saying but tell me how to multiply a point with a rotation or translation matrix?
Is there any OpenGL function which does that for you or what?

Share this post


Link to post
Share on other sites
I have answered your question here...

Just note that the GPU will transform all vertices anyway, even if you don't specify a modelview/projection matrix! This is what the GPU is designed to do - by duplicating all this work on the CPU you essentially lose the benefits of hardware acceleration and make your code several orders of magnitude slower.

The only reason you should ever touch the vertices of an object, is to deform it in a permanent way.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fiddler
The only reason you should ever touch the vertices of an object, is to deform it in a permanent way.

I think the most often reason is importing a model from a modeling package that doesn't fit the game's world convention (okay, can be understood as "permanent deformation" ;)).

@OP: However, I agree that besides some special purposes one should keep the hands off it. Avoiding "loading identity matrices again and again" isn't such a purpose, IMHO, especially because one cannot avoid it anyway.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement