Skip to main content
gamedev.net
🔒 Locked

Vector issue

Started by CProgrammer Feb 21, 2003 at 12:33 AM 1 replies 200+ views
Original Post
CProgrammer
CProgrammer
Say i have 2 3d-Vectors. How do i get a vector specifying the part of the second vector that intersects the first diagonally. Vector a, b; vector b goes through a in a certain angle(however 3d). I need the vector that specifies the direction and power of b hitting a orthogonally(90degrees) -CProgrammer
Skizz
Skizz
plane_normal = narmalised (a) cross normalised (b)
orth = plane_normal cross narmalised (a)
magnitude_orth = b dot orth
orth *= magnitude_orth

You may need to change the order of the cross products to get the direction right since:
a cross b = -(b cross a)
I can never remember which way it goes.

Skizz

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.