Software Archive
Read-only legacy content
17061 Discussions

[Unity] How to make hand model face toward the monitor, instead of the user?

Granger_L_
Beginner
604 Views

Hi,

I noticed that in the Unity Hands Animation sample, the hand models are facing the user as if the user were looking into a mirror, while in the OpenGL sample, the hands were facing away from the user, as if the user were reaching into the screen.

I am trying to achieve the "reaching into the screen" effect in Unity and was hoping I could get some tips on how to do this :)

Thanks!

0 Kudos
1 Reply
Granger_L_
Beginner
604 Views

After some tinkering, I've finally figured it out. 

In the Hands Viewer Script that is attached to the Main Camera, I used the negative of the z-value of the 3D points and adjusted the value a bit.

Original:

myJoints.transform.position = new Vector3(-1 * smoothedPoint.x, smoothedPoint.y, smoothedPoint.z) * 100f;

Modified:                  

myJoints.transform.position = new Vector3(-1 * smoothedPoint.x, smoothedPoint.y, -1 * smoothedPoint.z + 0.5f) * 100f;

The hand model now reaches "into the screen". Woo hoo!

0 Kudos
Reply