DSDSWeb/static/js/Cesium-1.53/Source/Shaders/Builtin/Functions/transformPlane.glsl

9 lines
432 B
Plaintext
Raw Normal View History

2024-07-11 18:02:47 +08:00
vec4 czm_transformPlane(vec4 clippingPlane, mat4 transform) {
vec3 transformedDirection = normalize((transform * vec4(clippingPlane.xyz, 0.0)).xyz);
vec3 transformedPosition = (transform * vec4(clippingPlane.xyz * -clippingPlane.w, 1.0)).xyz;
vec4 transformedPlane;
transformedPlane.xyz = transformedDirection;
transformedPlane.w = -dot(transformedDirection, transformedPosition);
return transformedPlane;
}