WorldWindJava
WorldWindJava copied to clipboard
Is the calculation of Bottom and Top Plane w correct?
Is the calculation of Bottom and Top Plane w correct?
I think..
line 230 in Frustum.java w = m.m44 + m.m23; => w = m.m44 + m.m24;
line 238 in Frustum.java w = m.m44 - m.m23; => w = m.m44 - m.m24; l Is right??
// Right Plane = row 4 - row 1:
x = m.m41 - m.m11;
y = m.m42 - m.m12;
z = m.m43 - m.m13;
w = m.m44 - m.m14;
d = Math.sqrt(x * x + y * y + z * z); // for normalizing the coordinates
Plane right = new Plane(x / d, y / d, z / d, w / d);
// Bottom Plane = row 4 + row 2:
x = m.m41 + m.m21;
y = m.m42 + m.m22;
z = m.m43 + m.m23;
w = m.m44 + m.m23;
d = Math.sqrt(x * x + y * y + z * z); // for normalizing the coordinates
Plane bottom = new Plane(x / d, y / d, z / d, w / d);
// Top Plane = row 4 - row 2:
x = m.m41 - m.m21;
y = m.m42 - m.m22;
z = m.m43 - m.m23;
w = m.m44 - m.m23;
d = Math.sqrt(x * x + y * y + z * z); // for normalizing the coordinates
Plane top = new Plane(x / d, y / d, z / d, w / d);