Advertisement

Math Problem

Started by May 19, 2000 05:43 AM
1 comment, last by MetalWorX 24 years, 7 months ago
i have the pitch and yaw angles along with a point in 3d space.how do i move it along the given direction?? i have employed the foll method-is it correct?? deltaX=dist * Sin(Yaw) * Cos(Pitch) deltaY=dist * Sin(Pitch) deltaZ=dist * Cos(Yaw) * Cos(Pitch) here the dist is the distance moved by the point in the particular direction and Yaw and Pitch are the angles made with the Y & X axis respectively. This formula fails when Yaw and Pitch are 45 degs=the vals i get are- here dist=1- deltaX=0.5 deltaY=1/(2^0.5) (one by root two!!) deltaZ=0.5 but the increments are supposed to be equal if they are inclined at 45 degs to both axes. Why is it like this? Pls help me out! Thanks a lot, Hey Witchlord ( Thanks a million for ur PATIENCE!!! ) sandeep_kl@mailcity.com
Raptor
You are doing it correctly, and no the increments are not supposed to be equal with yaw and pitch both 45 degrees. Unfortunately I don''t know how to explain why this is, other than that you should trust the math.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Advertisement
Hi WL,
I figured it out - (for once whew!! Out of the wicked spell at last)

Consider a point at (1,1,1)
the projection in the XZ plane is (1,0,1)
Now the pts Here the dst from x & z axis is 1 each.
while y is 1.414 more than x or y dsts.

thanx a lot!!


Jayanth.K
Raptor

This topic is closed to new replies.

Advertisement