Skip navigation

The XNA docs say:

d: The distance of the Plane along its normal from the origin

However, that is wrong.

The right description is:

d is the distance you must translate the plane along its normal to get to the origin.

For example, the plane

rightBoundaryPlane = new Plane( 1, 0, 0, 1000 );

Is a plane that has a normal pointing in +x. Using the xna vague (and inaccurate) description of d, you might think that d is “the distance of the plane along its normal from the origin..” i.e. this plane should be off 1000 units in the direction of +x.

In fact, that is WRONG. This plane intersects the x axis at ( -1000, 0, 0 ). Why -1000? Because d represents the number of units you must move this plane, along its normal, to get to the origin.

Meaning, this plane must intersect ( -1000, 0, 0 ) because moving the plane 1000 units in the direction of ( 1, 0, 0 ) would take you to the origin.

So how do you get a plane at the right (+X) side?

Use:

rightBoundaryPlane = new Plane( 1, 0, 0, -1000 );

This plane intersects ( 1000, 0, 0 ) because you’d have to move it -1000 units ALONG ITS NORMAL ( in the direction of (1, 0, 0) ) to get it to the origin

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: