Archived

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

D_JildQuantum

Multiple Copies of One Object

Recommended Posts

Ok, i know this is gunna sound corney, but how do i take one structure, like CQVPyramid that defines a pyramid in model space, and make multiple copies in different locations? im thinking something like:
//psuedo code

g_pDevice->SetTranslationMatrix(...)
DrawFirstPyramid(...)
g_pDevice->SetSecondTranslationMatrix(...)
DrawSecondPyramid(...)
in the Init function. I tried this, but it came up with an error. Is this the right way and i just need to fiddle with it, or is there some other *magical* way that im not getting? Quantum

Share this post


Link to post
Share on other sites
And just for reference, I believe you would want to set the World matrix (and DirectX supplies up to 256 of those, I believe, through the use of it''s D3DTS_WORLD() macro [<- check me on that macro, it''s in the SDK docs])

Chris Pergrossi
My Realm | "Good Morning, Dave"

Share this post


Link to post
Share on other sites
Yay! Thanks. I tried to start the scene once in initialization, set the matrix, render, and then in the real render function do the same thing, becuase i thaught it would keep the position once it had been performed. My only thing, isnt it costly when i have scenes of 20+ objects, to change the matrix each time? or is it only changing the View Matrix that is costly? Oh, and does anyone know of a good Index Buffer Tutorial? In this project, im sorta just adding on stuff as i learn it... (bad in practice, but hey, it works for now) Ill post a snap shot of my game so far in the Your Announcement forum once i figure out how...

Quantum

Share this post


Link to post
Share on other sites