How to use the Plane function from three
Find comprehensive JavaScript three.Plane code examples handpicked from public code repositorys.
GitHub: lwd-temp/trois
![lwd-temp profile picture](/lwd-temp.png?size=40)
51 52 53 54 55 56 57 58 59 60
var beforeRenderCallbacks = []; // mouse tracking var mouse = new three.Vector2(); var mouseV3 = new three.Vector3(); var mousePlane = new three.Plane(new three.Vector3(0, 0, 1), 0); var raycaster = new three.Raycaster(); // raycast objects var intersectObjects = [];
+ 32 other calls in file
GitHub: JamesHeal/trois
![JamesHeal profile picture](/JamesHeal.png?size=40)
25 26 27 28 29 30 31 32 33 34
resetPosition = new three.Vector3(0, 0, 0), } = options; const raycaster = new three.Raycaster(); const position = resetPosition.clone(); const plane = new three.Plane(new three.Vector3(0, 0, 1), 0); const updatePosition = (coords) => { raycaster.setFromCamera(coords, camera); camera.getWorldDirection(plane.normal);
+ 19 other calls in file
GitHub: K3D-tools/K3D-jupyter
![K3D-tools profile picture](/K3D-tools.png?size=40)
100 101 102 103 104 105 106 107 108
self.renderer.setViewport(size.x - self.axesHelper.width, 0, self.axesHelper.width, self.axesHelper.height); self.renderer.render(self.axesHelper.scene, self.axesHelper.camera); self.renderer.setViewport(0, 0, size.x, size.y); K3D.parameters.clippingPlanes.forEach((plane) => { self.renderer.clippingPlanes.push(new THREE.Plane(new THREE.Vector3().fromArray(plane), plane[3])); }); K3D.dispatch(K3D.events.BEFORE_RENDER);
GitHub: shinseed/BIMServer-NodeJs
![shinseed profile picture](/shinseed.png?size=40)
154 155 156 157 158 159 160 161 162 163
this.processing = false; this.loadCallback = null; //clip this.clipPlanes = [ new THREE.Plane(new THREE.Vector3(1, 0, 0), 0), new THREE.Plane(new THREE.Vector3(0, -1, 0), 0), new THREE.Plane(new THREE.Vector3(0, 0, -1), 0) ]; this.clipParams = {
+ 5 other calls in file
GitHub: K3D-tools/K3D-jupyter
267 268 269 270 271 272 273 274 275 276
quadRTT.material.uniformsNeedUpdate = true; renderer.clippingPlanes = []; K3D.parameters.clippingPlanes.forEach((plane) => { renderer.clippingPlanes.push(new THREE.Plane(new THREE.Vector3().fromArray(plane), plane[3])); }); renderer.setRenderTarget(textureRTT); renderer.clear(true, true, true);
GitHub: hobuinc/usgs-lidar
113 114 115 116 117 118 119 120 121 122
return points; }; RegionsController.prototype.makePlanes = function(region) { var points = this.toPoints(region); var v = new THREE.Plane(); region.planes = [ v.setFromCoplanarPoints(points[0], points[1], points[2]).clone(), // back v.setFromCoplanarPoints(points[7], points[4], points[0]).clone(), // left
GitHub: ASLS-org/studio
259 260 261 262 263 264 265 266 267 268
this.renderer.toneMapping = THREE.NoToneMapping; this.renderer.physicallyCorrectLights = true; this.renderer.setPixelRatio(window.devicePixelRatio); this.renderer.forwardRendering = false; this.renderer.toneMappingExposure = Math.pow(1.0, 2.0); var globalPlane = new THREE.Plane(new THREE.Vector3(0, 0, 0.5), 0.5); this.renderer.clippingPlanes = [globalPlane]; } /**
+ 3 other calls in file
113 114 115 116 117 118 119 120 121 122
if (!this.startPosition) { return; } const planeOffset = -this.startPosition.getComponent(this.extrusionComponent) * this.extrusionNormal.getComponent(this.extrusionComponent); const plane = new THREE.Plane(this.extrusionNormal, planeOffset); const intersection = this.raycaster.ray.intersectPlane(plane); if (intersection) { let diff = this.startPosition.clone().sub(intersection.clone());
+ 58 other calls in file
59 60 61 62 63 64 65 66 67 68
var stepsize = width / steps; var slices = []; for (var step = 0; step < steps; step++) { let planeZ = step * stepsize; var plane = new THREE.Plane(new THREE.Vector3(0, 0, 1), planeZ + stepsize); var slice = slicer(geo, plane, true); plane = new THREE.Plane(new THREE.Vector3(0, 0, -1), -planeZ); slice = slicer(slice, plane, true); slices.push(slice);
+ 3 other calls in file
GitHub: VeinKowal/veins
101 102 103 104 105 106 107 108 109 110 111 112 113
var startZoom = 0; var endZoom = 0; // ray caster for drag movement var rayCaster = new THREE.Raycaster(); var plane = new THREE.Plane(new THREE.Vector3(0, 0, -1)); // default parameters : var defaultOptions = { enableRotation: true, rotateSpeed: 2.0,
three.Vector3 is the most popular function in three (22341 examples)