Jump to content
  • Advertisement
Sign in to follow this  
LotusExigeS1

SLIMDX - plane/maths problem

This topic is 2663 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

Hello,

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.

Thanks,

Share this post


Link to post
Share on other sites
Advertisement
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!