View Single Post
Re: Strafing in a 2D world!?
Old
  (#5)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Strafing in a 2D world!? - 23-07-2004

Code:
 
 
Vector2D VDirection;
Vector VDir3D,VSide;
 
VDir3D.x = VDirection.x;
VDir3D.y = VDirection.y;
VDir3D.z = 0;
 
VSide = CrossProduct(VDir3D,Vector(0,0,1));
not tested, but it should look somewhat similar

the crossproduct of 2 vectors is perpendicular to both arguments and the length of the result is |length1| * |length2| * sin phi where phi is the angel between the arguments ...



Last edited by @$3.1415rin; 23-07-2004 at 23:13..
  
Reply With Quote