Archived

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

Serian

A basic misunderstanding

Recommended Posts

Serian    122
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 this post


Link to post
Share on other sites
CrazedGenius    156
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 this post


Link to post
Share on other sites
Oluseyi    2116
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!

Share this post


Link to post
Share on other sites