Jump to content

  • Log In with Google      Sign In   
  • Create Account

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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 08 May 2012 - 10:57 AM

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, 08 May 2012 - 11:44 AM.


Sponsor:

#2 Guilherme Silva   Members   -  Reputation: 153

Like
0Likes
Like

Posted 08 May 2012 - 02:09 PM

Do all the wheel have the same rotation? if so, why not instead only have one wheel and draw it multiple times?

#3 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 08 May 2012 - 10:52 PM

@Bayinx: I have created the whole model in 3Ds Max and loading it in DirectX using .x file, so the wheels has to be created in 3Ds Max.

#4 Tispe   Members   -  Reputation: 1044

Like
0Likes
Like

Posted 09 May 2012 - 01:08 AM

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?

#5 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 09 May 2012 - 05:48 AM

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, 09 May 2012 - 05:54 AM.


#6 Tispe   Members   -  Reputation: 1044

Like
0Likes
Like

Posted 09 May 2012 - 06:01 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS