- Vector3 normalizedPoint = new Vector3(p.fx - plane.center.x, p.fy - plane.center.y, p.fz - plane.center.z);
- color planeColor = getColor(normalizedPoint, plane.hue, plane.rotation, saturation);
+ normalizedPoint.x = p.fx - plane.center.x;
+ normalizedPoint.y = p.fy - plane.center.y;
+ normalizedPoint.z = p.fz - plane.center.z;
+
+ float v = plane.rotation.rotatedY(normalizedPoint);
+ float d = abs(v);
+
+ final color planeColor;
+ if (d <= thickness) {
+ planeColor = color(plane.hue, saturation, 100);
+ } else if (d <= thickness * 2) {
+ float value = 1 - ((d - thickness) / thickness);
+ planeColor = color(plane.hue, saturation, value * 100);
+ } else {
+ planeColor = 0;
+ }
+