Skip to main content
gamedev.net
🔒 Locked

world matrix question

Started by ctaclas Nov 3, 2004 at 2:15 AM 0 replies 350+ views
Original Post
ctaclas
ctaclas
hi i've recently started reading a book about direct x, and have been reading it and going through it's example code along with the sample code that comes with the sdk. i've started with the direct3d, and am starting to play around with it. i took the sample tutorial from the sdk called lights, which is basically a hollow cylindar rotating about the Y axis. i figured a good way to start playing with direct3d would be to make it display two cylindars, one translated to the right and rotating differently. to do this, after the call to DrawPrimitive that draws the original cylindar, i created another world matrix and applied the rotation and translations to it, and called DrawPrimitive again. my question is, if i'm drawing multiple shapes do i have to set up a world matrix for each shape? i'm thinking the answer is yes, but i just want to make 100% sure so that i don't miss something, because this seems to be one of the more fundamental concepts. thanks
bartiss
bartiss
I asked a similar question yesterday and here's the answer I was given:

"the pipeline of a video card consist of several stages. one of the stages does the transformation and pushes the transformed output to the next pipeline stage.
You start pushing vertices into the transformation stage when you call drawprimitiv. The transformation stage can be parametrized with a world transformation matrix. The stage uses this to transform the input vertices. Once the transformed output is generated, the transformation stage neve touches the vertices again. When you call drawprimitive again, you can set a new vertexstream or you can use the same vertexstream. But the input vertices this time will generate a new output while the last output is already pushed to the next pipeline stage. All input vertices are transformed once."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.