So, I’m trying to recreate z-targeting from the zelda games in my own, and to do this I plan on using the lookAt function. Unfortunately, it’s not working out for me, even if it is basic trigonometry.
I read the following articles on it:
http://www.euclideanspace.com/maths/algebra/vectors/lookat/index.htm
http://www.ehow.com/how_5717908_calculate-lookat-function.html
My problem is, even if I have the eye coordinates, and the target coordinates, I don’t know what to do about the current target coordinates. All I have available to use are the Yaw and pitch of my camera, so I don’t know how to take these and make the coordinates I need to get the proper dot product.
And even when I do get the dot product, I don’t know what to do about the arccos. In the second tutorial, the author says he got his angle from the arccos of 10. Of course in Java, the input of arccos can’t be over 1, so how do I get around this?
I’m sorry if these are obvious questions, my geometry teacher was terrible so most of my trig is self taught.
Thank you.