You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my point of view plane normalization contains a bug
Plane is defined with normal and distance.
That means, we should find some plane point just by multiplication:
P = N * D
if plane was defined like:
plane1(Vector3f(0.0f, 2.0f, 0.0f), 3.0f);
means, that P = (0, 6, 0)
after plane normalization with current implementation we will have:
plane1Norm (Vec3(0, 1, 0), 1.5);
as a result P1 = Vec3(0, 1, 0) * 1.5 = (0, 1.5, 0)
instead of (0, 6, 0)
I think in normalized method distance should be multiplied by magnitude instead of division.
Plane Plane::Normalized() const
{
float magnitude = m_normal.Length();
//Dividing the normal by it's length performs vector normalization.
//Distance however, must also be divided by the normal's length in
//order to create an equivalent plane.
- return Plane(m_normal/magnitude, m_distance/magnitude);
+ return Plane(m_normal/magnitude, m_distance*magnitude);
}
The text was updated successfully, but these errors were encountered:
Hello,
From my point of view plane normalization contains a bug
Plane is defined with normal and distance.
That means, we should find some plane point just by multiplication:
P = N * D
if plane was defined like:
plane1(Vector3f(0.0f, 2.0f, 0.0f), 3.0f);
means, that P = (0, 6, 0)
after plane normalization with current implementation we will have:
plane1Norm (Vec3(0, 1, 0), 1.5);
as a result P1 = Vec3(0, 1, 0) * 1.5 = (0, 1.5, 0)
instead of (0, 6, 0)
I think in normalized method distance should be multiplied by magnitude instead of division.
The text was updated successfully, but these errors were encountered: