transformPlane.glsl 485 B

123456789101112131415
  1. /**
  2. * Transforms a plane.
  3. *
  4. * @name czm_transformPlane
  5. * @glslFunction
  6. *
  7. * @param {vec4} plane The plane in Hessian Normal Form.
  8. * @param {mat4} transform The inverse-transpose of a transformation matrix.
  9. */
  10. vec4 czm_transformPlane(vec4 plane, mat4 transform) {
  11. vec4 transformedPlane = transform * plane;
  12. // Convert the transformed plane to Hessian Normal Form
  13. float normalMagnitude = length(transformedPlane.xyz);
  14. return transformedPlane / normalMagnitude;
  15. }