Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Changing the SPEED of a rotation.

impelluso
Registered User
Quote
2011-11-01 08:01:31

Good Morning.

I am learning a lot. But could I ask for help on one thing that as even confused me in Inventor.


INSIDE of a main routine, I created an AnimtorRotation and attached it to a scene node.

NOW, inside of a keyboard call back, I want to change the speed.

I know I COULD do this:
axleSceneNode.Rot.X += 1.0

But that is a ONE time change in the ANGLE.
I want to change the speed.

The speed is not a field like Rot.x is.

And this is where my ignorance begins (I am a mechanical engineer learning this).

BELOW is what I want to do. I know it is wrong, but could someone tell me how to change the SPEED inside a call back function SIMILAR to this intent:

document. = function(event)
{
var key = String.fromCharCode(event.keyCode);
if (key == 'F' && axleSceneNode) {
axleSceneNode.AnimatorRotation.Vect3d.Y += 0.1;
}
engine.handleKeyDown(event);
};


niko
Moderator
Quote
2011-11-02 02:55:19

You could do it like this (this is not documented, but working):


var ara = axleSceneNode.getAnimatorOfType('rotation');
ara.Rotation = new CL3D.Vect3d(1,2,3); // where 1,2,3 is your new rotation

// optionally, also do this depending on how you would the change to look like
// ara.StartTime = CL3D.CLTimer.getTime();



Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (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