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.

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 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 on other sites
ok thanks for that. I think I understand now.

1. 1
2. 2
3. 3
Rutin
24
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• Forum Statistics

• Total Topics
633651
• Total Posts
3013128
×