sizing objects in d3d

Started by
2 comments, last by monkey_face 22 years, 3 months ago
is it possible to resize an object declared in model space? ( during gameplay )? thanks to anyone that can help w/ some code.
Advertisement
I assume that scaling the matrix isn''t enough?

Neil

WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
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...
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?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

This topic is closed to new replies.

Advertisement