user1796942
user1796942

Reputation: 3528

A plane represented as normal and offset?

I am reading someone else's code and he represents a plane as a normal and offset, but I am not sure what that offset is. I guess it is distance from world origin to plane center?

Thanks

Upvotes: 3

Views: 8621

Answers (1)

AnT stands with Russia
AnT stands with Russia

Reputation: 320709

Most likely it is the "distance" from the world origin to the plane. Not to the "plane center" (what's "plane center"?), but to the plane itself.

I put the word "distance" into quotation marks because it could turn out that your "distance" is not normalized, i.e. it is multiplied by some factor.

The equation of 3D plane, as you probably know, is

A*x + B*y + C*z + D = 0

where (A, B, C) is the normal vector and D is actually the signed distance from the origin to the plane. However, D will represent regular Euclidean distance if and only if vector (A, B, C) is normalized, i.e. the values of A, B, C and D are scaled so that |(A, B, C)| = 1. If the vector is not normalized, then D is the distance multiplied by |(A, B, C)|.

Sometimes the term "offset" is used to refer to coefficient D in non-normalized plane equation. In other words, it is possible that in your case the plane is simply represented by its A, B, C and D coefficients. Whether they are normalized or not - you have to check yourself.

Upvotes: 10

Related Questions