playMaker

Author Topic: Quaternion orientation for oculus touch  (Read 1936 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Quaternion orientation for oculus touch
« on: December 22, 2016, 07:41:10 AM »
Hello,

i'm actually building a setup for my hands, used with touch, and i have to say that i 'm understanding nothing about the way quaternions are doing there jobs.

So let's start by a simple setup of the hands and the touch:
For the oculus and touch managing, i fund OVR wich works nicelly and detect both right and left touch, also reacting to inputs without additionnal code.

for the hands,, i made mine, with bones from forearm to fingers.
if the forearm is linked to touch position and oculus orientation, it's ok, not perfect but good for a start,
for the hands, we need to get the orientation of the RightHandAnchor and LeftHandAnchor and the best setup seems to get the quaternion in local of these nodes and set the quaternion orientation of the bones of the hands.

the result is better than using Euler XYZ axis, but to manage precisely my quaternion, i'm a bit lost, my hand XYZ doesn't rotate in the good direction, so i will have to inverse Y and Z and maybe something else.

is it an action available to manage quaternion or someone that can explain me more about it ?

codewalker

  • Playmaker Newbie
  • *
  • Posts: 1
Re: Quaternion orientation for oculus touch
« Reply #1 on: February 12, 2017, 12:47:35 AM »
Quaternions are not simple or easy to understand. Unity recommends never touching them unless you are an expert.

All rotations internally in Unity are Quaternions.

So, I don't have an answer.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Quaternion orientation for oculus touch
« Reply #2 on: February 14, 2017, 01:50:35 AM »
Hi,

Would it not be better to have an Inverse kinematic system here? it seems the right approach here.

 Your IK chain would follow the hands anchor position and rotation.

but just for info, to express a rotation in local coordinates, you ask unity the "localRotation", you can do so with a custom action on the Ecosystem called "GetLocalRotation".

 
Bye,

 Jean