Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Rotating a mesh a two différents center

falcon12
Registered User
Quote
2017-03-22 19:38:51

Hi,

Suppose you want to use a mouse robot 3D mesh like this.

You want the mesh to rotate around its 2 wheels (like it is in the reality when only one wheels is turning), and go ahead when the two wheels rotate at same speed.


So CC must rotate the same mesh around too center, on command.

I'm actually working on that problem using a rather complicated méthod. Does someone see a simple way to do that ?

🔎︎



niko
Moderator
Quote
2017-03-30 04:18:05

Other than manually calculating the rotation (+ new position) I don't see a very simple method, sorry.


crackyourspeaker
Registered User
Quote
2017-03-30 06:24:05

You want the wheels to turn??


falcon12
Registered User
Quote
2017-04-04 11:59:45

Niko:I made the mouse son of a dummy cube centered on one of the 2 wheels or the mouse mass center. I move programmaticaly the mouse on one of these point and use the dummy father to rotate or translate the mouse.


just_in_case
Moderator
Quote
2017-04-04 18:23:25

Please explain more clearly what you want to do with that mouse mesh...


Do u want it to rotate left on the axis when its left wheel is in work...

And rotate right when its right wheel is in work...

And wanted that if both wheel are working than the mouse will move forward...


If this is what you want then you can do it easily.....

But first let me know... What you actually wants to do with mesh...


falcon12
Registered User
Quote
2017-04-04 22:33:58

Yes Just-in-case, you understood my problem


just_in_case
Moderator
Quote
2017-04-05 18:35:26

There are many ways to do this....

Suppose you have on key pressed do something behaviours in the scene like...

When key pressed = left_mouse click...
Then play animation of turning of left wheel..
Also add action change rotation of a scenenode... And then change the value of x-axis to negative...and leave y-axis and z-axis to zero...

For example set rotation of x-axis to -10...


Do something like this with right mouse click...

When a key pressed = right_mouse click....
Then play animation of turning of right wheel...
Also add an action change rotation of a scenenode....and then change the value of x-axis to positive .... And leave y-axis and z-axis to zeeo...

For example aet rotation of x-axis to +10...


Now again when a key pressed middle mouse button...

Play animation to rotate both wheels...
Now instead of changing rotation ...change the position of scenenode...

Change position of scenenode.... Move a vector into the facing direction.....

Now your problem will be solved...

I hope so..... Will try to do something like this tommarow.. and will send you the ccb file..


falcon12
Registered User
Quote
2017-04-29 19:40:46

Thanck you just_in_case . I solved the problem computing rotation/translation around a center positionned on wheel center .


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internati?nal" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact