How to use the Plane function from three

Find comprehensive JavaScript three.Plane code examples handpicked from public code repositorys.

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 = [];
fork icon271
star icon0
watch icon0

+ 32 other calls in file

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);
fork icon271
star icon0
watch icon0

+ 19 other calls in file

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);
fork icon119
star icon812
watch icon25

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 = {
fork icon13
star icon28
watch icon7

+ 5 other calls in file

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);
fork icon115
star icon803
watch icon0

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
fork icon13
star icon110
watch icon0

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];
}

/**
fork icon0
star icon7
watch icon0

+ 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());
fork icon1
star icon1
watch icon2

+ 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);
fork icon1
star icon1
watch icon2

+ 3 other calls in file

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,
fork icon0
star icon1
watch icon0

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)