Advertisement

Direct3D IM Transformation (easy)

Started by February 07, 2000 08:05 AM
3 comments, last by Gandalf 25 years, 1 month ago
How to rotate a object? Not moving the world transformation or view transformation matrix around the object. Just rotate one special object. Not all of them just one. Thanks. PS! Im a newbie in Direct3D. Gandalf the White
Edited by - Gandalf on 2/7/00 8:39:21 AM
Gandalf the Black
is the object in its own coordinate system? or already stuffed into the world? if it''s in local, you should be able to do it in world (concatenate the rotation then scale then position) matrix. set the d3d world matrix and pass the local coord verts of the object to it, it will be rotated around its origin, scaled and moved to its pos in the world. if this ''object'' is already in the world coords, then it isn''t what i define to be an object, rather a collection of segments in the world... in that case, you have to take these segs, make copies of them, slide them to the origin, create a matrix, and send them to d3d. sorry, i don''t know of a better way here.
Advertisement
Thanks for your answer. Lets say I have the D3DVERTEX points for two cubes global and they are initialized. The identity matrix is setted up (1,0,0,0) for the world (D3DTRANSFORMSTATE_WORLD). Now if I transform the world matrix, both cubes is transformed. That is not what I want. How can I just rotate one of the cubes?

Gandalf the White


Edited by - Gandalf on 2/8/00 3:09:49 AM
Gandalf the Black
You have to change the viewmatrix between rendering the two cubes.
Thanks.

Gandalf the White

Gandalf the Black

This topic is closed to new replies.

Advertisement