xrfragment/src/3rd/js/three/xrmacro/clip.js

11 lines
277 B
JavaScript
Raw Normal View History

2023-08-24 13:36:41 +02:00
xrf.frag.clip = function(v, opts){
let { frag, mesh, model, camera, scene, renderer, THREE} = opts
if( v.x == 0 ) v.x = 1; // THREE.js .near restriction
console.log("└ clip "+v.x+","+v.y);
camera.near = v.x
camera.far = v.y
camera.updateProjectionMatrix();
}