plane vectors from two points

This topic is 4068 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

If I subtract two points to acquire a direction vector for use in a plane I get strange results when projecting, like (2,3.0) - (-5,7,8). I figured out that by only using the second point or direction as such that the plane projection would work, for example direction - 0,0,0(origin) which isn't really subtracting anything. It makes some sense but I don't understand fully.... and would like. I have ended up doing the projection then displacing it to the location I require it... I hope this made sense. Thanks in advance. -M@

Share on other sites

Projecting a direction vector onto a plane just yields in another direction vector. Since direction vectors have no start or end but a direction and length only, you could not expect it to occur at any _position_.

The correspondence is as follows: The difference of 2 position vectors yields in a direction vector (as you've stated correctly). Projecting the both points onto a plane and computing the difference of the projected points yields in the same direction vector as projecting the original difference vector onto that plane.

Projecting a point V onto a plane P
P := { O n }
where O denotes any point on the plane (e.g. its "origin") and n the plane's normal (orthogonal and of unit length), one would do
VP := V - n * ( n . ( V - O ) )
what actually computes the shortest difference vector from the plane to V and subtracts that from V. That means
a position = a position - a direction * a scalar
where
a scalar = a direction . a direction
so all is okay.

EDIT:
If, on the other hand, you are computing a difference vector d first and want to project that, you have to go a slightly other way:
dP := d - n * ( n . d )
what means
a direction = a direction - a direction
what is also okay.

The difference of these two ways if looking at the formulas (e.g. assuming you are using a vector implementation that doesn't distinguish between positions and directions) is in the right term of the dot-product. Perhaps that is the pitfall you're trapped in?

1. 1
Rutin
41
2. 2
3. 3
4. 4
5. 5

• 16
• 18
• 12
• 14
• 9
• Forum Statistics

• Total Topics
633362
• Total Posts
3011526
• Who's Online (See full list)

There are no registered users currently online

×