playMaker

Author Topic: Rotating objects at an angle using local axis.  (Read 2002 times)

smiffy

  • Junior Playmaker
  • **
  • Posts: 54
Rotating objects at an angle using local axis.
« on: May 09, 2017, 06:10:07 AM »
Hi there, hoping someone can help.

I have an object that is placed into a scene matching the slope of the plane it sits on.

I can add a random rotation using the rotate action and it rotates item on a slope properly on the local axis.

Setting the rotation does not work though. I'm not too good with euler angles but this is what i've tried.

Get Rotation: save the Euler Angle (v3Euler)
Set V3 XYZ: Create a new rotation around the Y axis, eg 0,255,0 (v3NewRot)
Vector3 Lerp: From v3Euler to v3NewRot . (v3Lerp)
Set Rotation: Euler to v3Lerp.

Everything is set to self but it still rotates on the world axis.
Can anyone help please?

Regards,
Matt

smiffy

  • Junior Playmaker
  • **
  • Posts: 54
Re: Rotating objects at an angle using local axis.
« Reply #1 on: May 22, 2017, 05:53:13 AM »
Can anyone please help with this at all?

Why is it that the Rotate action will rotate around the local axis but set rotation will not? And how can I set rotation using a local axis?

Thanks
Matt