binhpt / slimmath

Automatically exported from code.google.com/p/slimmath
0 stars 0 forks source link

Plane scaling #11

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi, I was searching documentation on how implement geometry of planes in 3D and 
I've found your project. A problem I've found is in aritmethic of planes. I saw 
that you scales a plane by multiplying the four coefficients by a given value, 
but if a plane is given by:

ax + by + cz + d = 0, we can see that

Value*(ax + by + cz + d) = ax + by + cz + d = 0

May you tell me what is the sense of this operation?

Thanks by your atention.

Original issue reported on code.google.com by jwl...@gmail.com on 21 Dec 2010 at 9:43

GoogleCodeExporter commented 8 years ago
I agree that our current scaling math is incorrect. The math you show is 
completely accurate (obviously). I believe the correct way to scale a plane is 
to simply multiply its distance. Although it is hard for me to find references 
on this, that is what makes the most sense to me.

I will do more research to figure out the correct way to scale a plane, but we 
do know now that the current method we use is wrong. Thank you for pointing 
this out!

Original comment by Jorgy...@gmail.com on 15 Feb 2011 at 3:25

GoogleCodeExporter commented 8 years ago
I think so. 

The reason for my question was that I had looked at several sites, including 
the DirectX documentation, and they resolved it this way. I thought I missed 
something.

Original comment by jwl...@gmail.com on 15 Feb 2011 at 5:26

GoogleCodeExporter commented 8 years ago
What I did in r42 is I created a Scale method for the Plane type that scales 
only the d component. The multiply by scalar methods still multiply each 
component (a, b, c, and d) by the scalar, however this is stated in the XML 
comments.

I am considering this an interim fix as I try to gain my insight into this. I 
checked out MDX and XNAMath and both multiply every component by the scalar.

Again, thanks for bringing this to our attention.

Original comment by Jorgy...@gmail.com on 16 Feb 2011 at 3:37