Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MajorIdea on July 12, 2018, 02:09:39 PM

Title: Aligning Direction Vectors
Post by: MajorIdea on July 12, 2018, 02:09:39 PM
I'm trying to make the Up direction on the left box mirror the up direction of the right.

(https://i.imgur.com/mgATx19.gif)

It's not about mirroring the rotation transform (would just use a get/set rotation) but aligning the direction so this can be used to align the box with any direction (like a surface normal)

Quaternion.FromToRotation seems to be the thing to use  and I think I'm using the playmaker equivalent https://hutonggames.fogbugz.com/default.asp?W1330 (https://hutonggames.fogbugz.com/default.asp?W1330) but its not working.

Any ideas?
Title: Re: Aligning Direction Vectors
Post by: MajorIdea on July 12, 2018, 04:22:29 PM
Quaternion Look Rotation seems to give better results (Creates a rotation that looks along forward with the the head upwards along upwards.) but it seems there's no way of using anything but the forward.

Changing the Up Vector seems like it should do the trick but nothing.

(https://i.imgur.com/8fdp6r8.gif)

Is there an operation that can be made to use the up vector instead of forward or is that outside of what can be made with existing playmaker actions?
Title: Re: Aligning Direction Vectors
Post by: djaydino on July 13, 2018, 09:48:34 AM
Hi.
I am not sure if this you useful for you...
But maybe you can use the actions 'Get Vector3 XYZ' and 'Set Vector3 XYZ' to swap the vectors .
For example get x and set it to y.

Then you can also use a float multiply  (multiply by -1) to invert the value, so for example +20 will become -20

Title: Re: Aligning Direction Vectors
Post by: MajorIdea on July 13, 2018, 10:24:57 AM
Man, I thought that would totally work. It's a great idea but it seems that wont work with a action using Forwards (like QuaternionLookRotation or SmoothLookAtDirection).

I can swap and invert the values and have it change it's behaviour but it doesn't seem to change the fact that it's using Forwards.

(https://i.imgur.com/0DSyV5M.gif)

It's not easy to see but even swapping the Y and Z values, the blue forward vector is still the one mirroring the circular motion of the Up green vector on the right box.  ???