I’m making a VR Grab/rotate thing and so each frame I have the position of the pointer newPoint and the previous frame’s position prevPoint and an object that is going to be rotated model. I’m trying to use GetAngleBetweenVectors to get the angle to rotate the object.
For the sake of simplicity, I’m hard coding the rotation to be only the Forward axis. The pivot point is moved to the corner so it’s basically a lid that opens to the right, like so:
Unfortunately this is changing the amount of rotation based on my Z position. I know I have the third parameter of the GetAngleBetweenVectors function incorrect, but I don’t know what the normal should be for this case.
I had a lot of scratch code in a Playground to test stuff out and get an understanding, but twice I’ve hit alt-left and lost everything. Anyway, the result I’ve found is if I project the vectors onto the axis I get the results I expect. Here’s how it looks