sizing objects in d3d
is it possible to resize an object declared in model space? ( during gameplay )?
thanks to anyone that can help w/ some code.
I assume that scaling the matrix isn''t enough?
Neil
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
Neil
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...
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?!?!
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?!?!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement