Sign in to follow this  

Scaling animated ID3DXMesh

This topic is 3736 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

I think it's fairly easy to scale a non animated ID3DXMesh (just go through its vector coordinates and multiply it by a scaler). But this obviously can't be applied to animated models. So I was wondering if anyone knows if it is even at all possible to scale the size of an animted ID3DXMesh and if so, how?

Share this post


Link to post
Share on other sites
Quote:
Original post by chillypacman
I think it's fairly easy to scale a non animated ID3DXMesh (just go through its vector coordinates and multiply it by a scaler).

But this obviously can't be applied to animated models. So I was wondering if anyone knows if it is even at all possible to scale the size of an animted ID3DXMesh and if so, how?


Why is it obvious that this can't be applied to animated models?

An animated model is no different than an ordinary model in the sense that you can surely lock its vertex buffer and scale all the vertices.

Of course, scaling produces problems anyway in that it messes with your vertex normals. Generally people get everything in the proper coordinate space by managing their content pipeline, not at runtime.

Share this post


Link to post
Share on other sites
Quote:
Original post by chillypacman
Animated models have bones to deal with which wouldn't be so easy to scale...


You can most certainly scale an animated mesh. Just include a scaling matrix when deriving the world matrix for the root frame. Of course you will have to get a little fancier if you don't want to scale about the origin.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
Quote:
Original post by chillypacman
Animated models have bones to deal with which wouldn't be so easy to scale...


You can most certainly scale an animated mesh. Just include a scaling matrix when deriving the world matrix for the root frame. Of course you will have to get a little fancier if you don't want to scale about the origin.


How do I include a scaling matrix?

Should I just create a D3DXMATRIX of a certain scale?

Share this post


Link to post
Share on other sites
Quote:
Original post by chillypacman
How do I include a scaling matrix?

D3DXMATRIX scale_matrix;
D3DXMatrixScale(&scale_matrix, x_scale, y_scale, z_scale);

Then compose this scaling matrix with the world-matrix at the appropriate points; once per bone. Presumably, this would be after walking the skeleton tree, but before applying the model's global translation.

Admiral

Share this post


Link to post
Share on other sites

This topic is 3736 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this