Skip to main content
GameDev.net gamedev.net
🔒 Locked

Plane Culling......?

Started by JDev Dec 27, 2004 at 6:01 PM 3 replies 750+ views
Original Post
JDev
JDev
Hi, I'm new to 3D mathematics and I was wondering how the computation of determining if a point lies on one side of a plane or another. I'm trying to use this knowledge for implementing plane culling (I think that's what it's called), so that I only render the objects in my viewing frustnum. I know it has something to do with a plane being described as Ax+By+Cz+D=k or something simular, but I'm not sure on the exacts. Help! thanks in advance, JDev
Zakwayda
Zakwayda
A plane can be represented by a (normalized) normal, and a distance from the origin. In your equation, A, B and C are the x, y and z components of the normal, and D is the distance.

Given that information, the distance from a point to a plane is:

point.Dot(plane.normal) - plane.distance

[Edited by - jyk on December 27, 2004 6:13:35 PM]
gorgorath
gorgorath
And if you're certain that your plane is aligned with on of the axis, you only have to compare one component of your point ( x, y, z ) with the distance of the plane to quickly determine if the position of a point.
Cosmic Keys to my Creations & Times
Puzzler183
Puzzler183
Quote:
Original post by jyk
A plane can be represented by a (normalized) normal, and a distance from the origin. In your equation, A, B and C are the x, y and z components of the normal, and D is the distance.

Given that information, the distance from a point to a plane is:

point.Dot(plane.normal) - plane.distance


The normal does not have to be normalized. It can be anything. Distance is simply scaled appropriately with it.
Zakwayda
Zakwayda
Quote:
The normal does not have to be normalized. It can be anything. Distance is simply scaled appropriately with it.


Sorry, I should have said 'usually normalized'. Often we want to know the exact distance from a point to a plane, e.g. for sphere/plane intersections and so on. Since planes are often calculated as a preprocessing step, the normalization is usually not a big deal.

However, there are some cases, such as testing if a point is in a polygon using 'side planes', where normalization is not necessary.

Sorry I wasn't more clear.

Topic Locked

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

Sign in to reply to this topic.