Sign in to follow this  

Rotating multiple wheel (C++, DirectX and 3Ds Max)

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

If I have 12 wheels and want to rotate them at once around themselves, how can I do that without having to select each wheel and rotate it or multi-select them?

I am looking to do that so I control all the wheels in DirectX (C++) without having to rotate each one by its name.

I want to use this:
ChangeFrameMatricesByName("wheels", &matWorld); // This line should affect all the wheels with the name (wheel1, wheel2, wheel3, etc...)

and NOT this:
ChangeFrameMatricesByName("wheel1", &matWorld);
ChangeFrameMatricesByName("wheel2", &matWorld);
ChangeFrameMatricesByName("wheel3", &matWorld);
ChangeFrameMatricesByName("wheel4", &matWorld);
ChangeFrameMatricesByName("wheel5", &matWorld);
ChangeFrameMatricesByName("wheel6", &matWorld);
// Etc... Edited by Medo3337

Share this post


Link to post
Share on other sites
All wheels need to be translated to origin before rotation or you have to do an offset rotation using D3DXMatrixTransformation for each wheel. In any case, each wheel needs to run different code as they are not at in the same position, I think.

Consolidate each wheel manipulation into a single function and call that instead?

Share this post


Link to post
Share on other sites
Lets say that I have the wheels named "wheel" in 3Ds Max, is there is a way that can make me find EACH wheel that has the name "wheel"? This would be much better than making everyone has number like wheel1, wheel2, wheel3, etc...

I want to name them all the same name "wheel" and be able to rotate EVERY sub mech that has the name "wheel".

I tried D3DXFrameFind() but it only get one wheel from the 12, even when they all have the same name. Edited by Medo3337

Share this post


Link to post
Share on other sites
If each wheel is named "wheel" my guess is that they will all belong to the same subset, and that complicates things. Because you draw each subset with only one draw call, using the fixed function pipeline only one transformation will be applied to the whole subset. So if you can only rotate around a single point for the whole group of wheels, it will be impossible to rotate them each individually.

Share this post


Link to post
Share on other sites

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