#### Archived

This topic is now archived and is closed to further replies.

# A basic misunderstanding

## Recommended Posts

Greetings, folks Despite my research, one important concept about D3D that, while most likely basic to those fluent in the library, still evades my understanding. In a nutshell, how do you move multiple untransformed objects independent of each other? For example, in an application that only draws two trianges, these objects, if created as transformed vertices, can be moved at will by locking each of their buffers, modifing the vertices, then drawing them again. This, however, seems rather inefficient for a real application that must draw a large number of polygons. From what I''ve read, another way to move objects would be to modify the world, view, and projection matrices. But it''s my understanding that this is done at the device level, so changing any of these matrices would modify the way all objects on that device are drawn. This is what confuses me. Look at the today''s 3D MMORPG''s (EQ, DAOC, etc) for instance. I''d assume the the PCs and NPCs being displayed are meshes, but they all move independent of one other. Do they simply modify the world, view, and projection matrices for every object being drawn? My theory would be no, but, like I said, I''m confused Any assistance in understanding this would be greatly appreciated. Thanks, //Serian

##### Share on other sites
Yes, the world matrix is passed to the device, but the matrix can be changed for every object.

Don''t think of the world matrix as "where is the world", think of it as "where is this object in the world". So, rendering multiple objects looks like this:

SetMatrixForObject1
DrawObject1
SetMatrixForObject2
DrawObject2

and so on...

##### Share on other sites
Transformation matrices.

Given an object X, multiplying each of its vertices by a transformation matrix will relocate them at a new position (say, X''). Since a single object may be composed of several composite polyhedra, a single "object" may employ several t-matrices. This transformations were traditionally done in software. I can''t give you specifics, but I wouldn''t be surprised if there was functionality to use a buffer of t-matrices in conjunction with an index buffer of some sort to allow the hardware do all that manipulation.

As always, someone better informed will come by and give you more details.

Happy Hacking!

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!

• ### Forum Statistics

• Total Topics
628320
• Total Posts
2982057

• 12
• 9
• 9
• 13
• 11