Jump to content
  • Advertisement
Sign in to follow this  

SLIMDX - plane/maths problem

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

If you intended to correct an error in the post then please contact us.

Recommended Posts


If I define 2 vector3's as -

v1= Vector3(100, 0, 250)
v2=Vector3(150, 0, 300)

and then get the normal using -

n=Vector3.Cross(v1, v2)

create a plane -

p=Plane(v1, n)

I then create a player point with -

player=Vector3(150, 0, 200)

I simply now want to test that player position against the plane (front or behind), but it doesnt work. I use this to test -

return Plane.DotCoordinate(p, player) >0

Any help is much appreciated.


Share this post

Link to post
Share on other sites
Just quickly doing the maths in my head, since all your Y-components are 0, your plane is going to have a normal of (0, 1, 0) (at least once you've normalized it).

Which means that your point 150, 0, 200 will actually be on the plane, rather than either side of it, resulting in Plane.DotCoordinate returning 0.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!