PDA

Voir la version complète : infinite rotation



lenogre
19/12/2003, 16h50
A propos de cette expression (je crois qu'elle faisait partie des goodies de la version 7), je n'arrive pas à modifier la vitesse de rotation.

Qq peut-il m'indiquer la manip car j'ai beau vouloir changer les valeurs, à chaque fois que j'ouvre à nouveau l'expression, les valeurs ne changent pas ! Pour mémoire je l'ai copiée dans le message.

// Infinite Rotation Expression

// ©2000 MAXON Computer, GmbH and MAXON Computer, Inc.

// Written by bhodiNUT llc

// This Expression rotates the given object
// continually during an animation rotating
// the "the_Rotation * the_Speed" every second.

main ( the_Document, the_Object)

{

// "the_Orientation" is the rotation of the
// object at time zero. The vector is specified
// in HPB angles and the components are
// described as radians ( PI == 180° ).
// Please refer to SDK for explanations of HPB
// and radians.

var the_Orientation = vector ( 0, 0, 0 );


// "the_Rotation" is the amount of rotation
// added to the object every second. The vector
// is specified in HPB angles and the components
// are described as radians ( PI = 180° ).

var the_Rotation = vector ( 0, 1, 0 );


// "the_Speed" is the speed of the rotation.
// It's value is multiplied times the current
// time yielding a temporal scale of the
// function.

var the_Speed = 2.0;


// "the_Object_Rotation" is the result of mixing
// "the_Orientation" and "the_Rotation" by using
// the result of the current time in seconds
// times "the_Speed". The "Mix" function will
// evaluate what is commonly referred to as
// undershoot and overshoot if the values are less
// than zero or greater than one.

var the_Object_Rotation = Mix ( the_Orientation, the_Rotation, the_Document->GetTime ( )->GetSecond ( ) * the_Speed );


// Above we calculated the rotation for the object
// at the current time. Now we must tell the
// object to orient itself to the current rotation.
// This is achieved using the SetRotation( )
// function. This function expects a vector
// containing HPB angles specified in radians.

the_Object->SetRotation ( the_Object_Rotation );

}

parksto
19/12/2003, 16h58
essaye de cliquer sur compiler avant de fermer ta fenètre :wink:

Steph3D ::.
19/12/2003, 17h01
Il suffit juste de changer la variable the_Speed

Ça marche bien, mais effectivement faut jammais oublié de compilé pour rentre à jour les modif du code :-)

lenogre
19/12/2003, 17h43
Merci, je savais pas !