RE: [Algorithms] Where is the enemy?
Brought to you by:
vexxed72
From: Steve W. <Ste...@im...> - 2000-07-25 02:10:18
|
Come to think of it...the vector can be eliminated since it's in both equations...just this test need be done: if Px + Py + Pz > P1x + P1y + P1z then it's to the right if Px + Py + Pz < P1x + P1y + P1z then it's to the left if Px + Py + Pz = P1x + P1y + P1z then it's straight ahead R&R > From: Aldo . [mailto:al...@ho...] > How can I decide wich side must I turn? > > I've tried cross product, but it doesn't worked fine. > > Any sugestions? > Hmm, how about using the equation of a plane which has at it's normal a vector V pointing at a right angle to the up and forward vectors and positive to the right: VxP1x + VyP1y + VzP1z = C1 Where C1 would be an index to compare with C in VxPx + VyPy + VzPz = C that tells you if point P is to the right (C>C1) or left (C<C1). R&R |