Archived

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

monkey_face

sizing objects in d3d

Recommended Posts

thedo    124
I assume that scaling the matrix isn''t enough?

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
monkey_face    122
i tried that, and believe i did it correctly..

D3DXMatrixScaling(&someMatrix,theX,theY,theZ);

and added to one of the coordinates before...but it only moves the object. i''m assuming i''m going to have to re-initialize the vertices? that doesn''t seem logical, though...

Share this post


Link to post
Share on other sites
thedo    124
I use this code - don''t know how fast it is (it does 2 matrix multiplies).

D3DXMATRIX MatTemp,Scalem;
D3DXMatrixIdentity(&Scalem);
D3DXMatrixScaling(&MatTemp,x,y,z);
D3DXMatrixMultiply(&Scalem, &Scalem, &MatTemp);
D3DXMatrixMultiply(&Matrix, &Scalem, &Matrix);

Just a note - if the model is not central (ie it''s origin is not 0,0,0) then your model will ''move'' when scaling.

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites