A basic misunderstanding

Started by
1 comment, last by Serian 22 years, 3 months ago
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
Advertisement
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...
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
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!

This topic is closed to new replies.

Advertisement