views:

432

answers:

1

Before everyone jumps on me for outsourcing my homework, my question is not a question on my homework. I'm just having a problem getting some stuff to draw properly.

I'm trying to draw lines perpendicular to a plane. I know the three points in space the make up the plane. From those coordinates I can calculate vectors and get the normal vector of the plane. Using the coordinates from the center of the three points and the normal vector I can draw a line perpendicular to the plane.

My problem is that the length of that line is tied to the normal vector because I'm just adding the vector to the coordinates to get two points to draw a line on. Without using some hideous brute-force code how do I draw a line of fixed length given any point in 3D space and any vector.

(I'm asking here because I don't know terms to use to search on google, my textbook doesn't have anything dealing with this, and my professor isn't going to be available before this is due.)

+6  A: 
ShoeLace
So the normal vector is (x/n, y/n, z/n) with 'n' being the vector's magnitude? (Retrieved from a random website about normalizing vectors)
epochwolf
yep.. doing that means the length/magnitude of you vector becomes 1.. (becuause x/x == 1 (for non-zero x)
ShoeLace
Thanks! This helps alot.
epochwolf