Simulating the rotation angle of an object with the movement of another.

hectorales

New member
Joined
Nov 30, 2017
Messages
1
Hello everyone, I have been programming a Virtual Reality (VR) experience where you are in a simulation of a firing range with a rifle that use a bolt action mechanic to reload, like this: https://www.youtube.com/watch?v=XIa6I2ODe5A

So in this VR experience you can use two motion controllers that simulate your hands in real time, so you can interact with the 3D objects.

What I'm having trouble with is of simulating the angle the bolt must rotate, by using the movement position of the controller which will move like a hand trying to rotate the bolt, something like this:

Bolt Action Movement.jpg

In this program I can get the vector of position form both the bolt and the controller (x,y,z), and also get the rotation in Euler angles of both objects (x,y,z) or even more complicated the Quaternion angle of both (x, y, z, w).

Is there a mathematical way of getting that angle of rotation by only using the movement of the controller?
 
Top