playMaker

Author Topic: Aligning Direction Vectors  (Read 183 times)

MajorIdea

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Aligning Direction Vectors
« on: July 12, 2018, 11:09:39 AM »
I'm trying to make the Up direction on the left box mirror the up direction of the right.



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 but its not working.

Any ideas?
« Last Edit: July 12, 2018, 01:14:27 PM by MajorIdea »

MajorIdea

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: Aligning Direction Vectors
« Reply #1 on: July 12, 2018, 01: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.



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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3613
    • View Profile
    • jinxtergames
Re: Aligning Direction Vectors
« Reply #2 on: July 13, 2018, 06: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


MajorIdea

  • Full Member
  • ***
  • Posts: 127
    • View Profile
Re: Aligning Direction Vectors
« Reply #3 on: July 13, 2018, 07: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.



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.  ???