Jump to content
  • Advertisement

Archived

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

sizing objects in d3d

This topic is 5976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?!?!

Share this post


Link to post
Share on other sites
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
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!