DanoOKC

Hello all. When creating a new plane object (for collision detection) I am curious as to the values used for the Plane(x,y,z,d) constructor. If for instance I wanted a plane located at 0,0,0 and is pointing straight up (+Y ), what would the correct values be for the constructor The d component I ASSUME(probably wrong) is the distance from world 0,0,0. If say the plane is rotated 90 degrees on the Z axis so that it runs up and down the world Y axis, what does that constructor look like I'm just not sure what the values should be specified in. World units, radians, degrees There isn't much of an explanation in the documentation and I'm sure this is probably trivial knowledge to most of you but I could use a little nudge in the right direction.
Thanks so much for your time.

Dan


Re: XNA Framework Plane constructor values question

Johnnylightbulb

There is also a constructor that takes a Vector3 for direction, and float for distance. It might make it easier to understand based on your needs (than a, b, c, d) if you use Vector3 and pass in something like Vector3.Up. For example:

Plane dividingPlane = new Plane(Vector3.Forward, 50.0f);

This would represent a plane 50 units (of whatever type you want, they have no set scale) away from the origin pointing forward.





Re: XNA Framework Plane constructor values question

DanoOKC

Thanks for that information. Your right in that I can get my head around using the Vector3.directions and probably work out from there how to do odd angles. Thanks very much for the response. Now if I can just get off work to do some coding :)
Merry Christmas!