Ya, ¿le coloco Rotation script y que más? Te digo que no entiendo de lo que hablamos. Donde ingreso el script que sale más abajo ya que el manual dice
Código:
here is the final script we come up with. As i said you ned to change the obj definition to math with your object name. Alos you may ned to change the timeres value which defines the time steps in which the movement assumed to be linear. We could avoid the Rotation axis calculations by turning the follow option in Path constraint on, but i wanted to make it compatible with key framed (and even procedural) Animations to.
-- you ned to change the below assingment.
-- if the name of the object you are assigning this controller.
-- is ball, then convert the line to.
-- obj = $ball.
-----------------------------------------
Obj = $sphere01 - change this.
Timeres = 1f - time resolution.
-----------------------------------------
Fn getrot te =
(.
If t<=0f then return quat 0 0 0 1 - t=0 => no Rotation.
T0 = t-timeres - previous frame time.
T1 = t - current time.
Rot0 = getrot(t0) - previous Rotation:
P0 = at time t0 (*.obj), position-- previous position.
P1 = at time t1 (*.obj), position-- current position.
If(p0==p1) then return rot0 - no distance is traveled.
Dif = p1-p0 - diference in positions.
Leen = length(dif) - distance that traveled.
Vec = dif / leen - normalized movement Vector.
R0 = at time t0 (*.obj), radius - previous radius.
R1 = at time t1 (*.obj), radius - current radius.
Rotax = cross Vec [0, 0, 1] - Rotation axis.
Angle = 360*len/((r0+r1)*pi)-- Rotation amount (in degs).
Rotdif = quat angle rotax - Rotation from t0 to t1.
Rot1 = rot0 + rotdif - total Rotation).
Getrot(currenttime).
Click evaluate and if no error is shot, click close in the script Rotation dialog box.
Esto donde lo coloco no entiendo, la verdad comprendo que me tratas de ayudar, pero tendrías que hacer un paso a paso.
Agrego el controller script Rotation y saldrá obviamente en blanco ya que tengo que agregar yo los valores y el script. Como sea agrega, donde se agrega y que se agrega.