Let’s say that we have function setAngle(x,y,z) which works perfectly.
Now we also have position of ourself and a chicken. How can we use setAngle() to aim the chicken? This would be done in an fps game? I have no idea on how to convert the positions to the angle… >.<
Let’s say that we have function setAngle(x,y,z) which works perfectly. Now we also have
Share
There is math? Let be yourself at point
and the chicken at
Ais part of planeE; its points satisfying the equationConsidering your game,
Eis possibly parallel to theXY-plane, so we haveThen, the angle enclosed by vector
ABand theXY-plane is the arcsin ofwhere
mag(n)is the magnitude of the surface normal ofEresp. of the vectorAB.Considering your function, this might proof unnecessary, for it seems to me like adjusting things for you already.