How to use the PlaneBufferGeometry function from three
Find comprehensive JavaScript three.PlaneBufferGeometry code examples handpicked from public code repositorys.
14 15 16 17 18 19 20 21 22 23
this.obj = this.createObj(); this.obj.visible = false; } createObj() { return new THREE.Mesh( new THREE.PlaneBufferGeometry(2, 2), new THREE.RawShaderMaterial({ uniforms: this.uniforms, vertexShader: require('./glsl/postEffect.vs').default, fragmentShader: require('./glsl/postEffectBright.fs').default,
+ 9 other calls in file
19 20 21 22 23 24 25 26 27 28
this.createObj(); } createObj() { // Define Geometry const geometry = new THREE.PlaneBufferGeometry(2, 2); // Define Material const material = new THREE.RawShaderMaterial({ uniforms: this.uniforms,
GitHub: K3D-tools/K3D-jupyter
210 211 212 213 214 215 216 217 218 219
Light Map support */ if (config.shadow !== 'off') { sceneRTT = new THREE.Scene(); quadRTT = new THREE.Mesh( new THREE.PlaneBufferGeometry(lightMapRenderTargetSize, lightMapRenderTargetSize), new THREE.ShaderMaterial({ uniforms: _.merge( uniforms, THREE.UniformsLib.lights,
GitHub: edankwan/Constraint
![edankwan profile picture](/edankwan.png?size=40)
13 14 15 16 17 18 19 20 21 22
var _resolution; var _uTime; function init() { var geometry = new THREE.PlaneBufferGeometry( 2, 2); var material = new THREE.ShaderMaterial( { uniforms: { uAlpha : exports.alphaUniform = {type : 'f', value: 1 }, uTime : _uTime = {type : 'f', value: 0 },
+ 3 other calls in file
136 137 138 139 140 141 142 143 144
// scene: nothing fancy // just a full screen quad // TODO: maybe a triangle to avoid aliasing on the edge var _scene = new THREE.Scene(); var _plane = new THREE.PlaneBufferGeometry( 2.0, 2.0 ); var _quad = new THREE.Mesh( _plane, _simulationMaterial ); _scene.add(_quad);
+ 9 other calls in file
117 118 119 120 121 122 123 124 125 126
self._updateNobData(props, self.state) self._updateNobs() }) var intersectPlane = new THREE.Mesh( new THREE.PlaneBufferGeometry(10, 10, 8, 8), new THREE.MeshBasicMaterial({ color: 0x000000, opacity: 0.25, transparent: true
54 55 56 57 58 59 60 61 62 63
blending: THREE.NoBlending, vertexShader: vertexShader, fragmentShader: precisionPrefix + glslify('./../glsl/quad.frag') }) planeGeometry = new THREE.PlaneBufferGeometry(2, 2) _quad = new THREE.Mesh(planeGeometry, copyMaterial) _quad.frustumCulled = false _scene.add(_quad) }
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385
const TransformControlsPlane = function () { THREE.Mesh.call( this, new THREE.PlaneBufferGeometry( 100000, 100000, 2, 2 ), new THREE.MeshBasicMaterial( { visible: false, wireframe: true, side: THREE.DoubleSide, transparent: true, opacity: 0.1 } ) ); this.type = 'TransformControlsPlane';
12 13 14 15 16 17 18 19 20 21
* @return {Object} 3D object ready to render */ module.exports = { create(config, K3D) { return new Promise((resolve) => { const geometry = new THREE.PlaneBufferGeometry(1, 1); const modelMatrix = new THREE.Matrix4(); const colorMap = (config.color_map && config.color_map.data) || null; let opacityFunction = (config.opacity_function && config.opacity_function.data) || null; const colorRange = config.color_range;
GitHub: amatelus/paintcoin
![amatelus profile picture](/amatelus.png?size=40)
147 148 149 150 151 152 153 154 155 156
const back0 = front0.clone(); back0.position.z = -THICKNESS / 4; back0.rotateY(Math.PI); scene.add(back0); const geometry = new THREE.PlaneBufferGeometry((RADIUS * 2) + (THICKNESS / 2), (RADIUS * 2) + (THICKNESS / 2), this.imageData.width, this.imageData.height); const material = new THREE.MeshBasicMaterial({
+ 5 other calls in file
86 87 88 89 90 91 92 93 94 95
render() { var base_render_promise = super.render(); window.last_image = this; this.image_plane = new THREE.PlaneBufferGeometry( 1.0, 1.0 ); this.image_material = new THREE.ShaderMaterial( { uniforms: { image: { type: 't', value: null }, // the domain of the image pixel data (for intensity only, for rgb this is ignored)
GitHub: utunga/deeppbr.ai
![utunga profile picture](/utunga.png?size=40)
204 205 206 207 208 209 210 211 212 213
var material2 = new THREE.MeshPhongMaterial( {color: 0x444444, side: THREE.BackSide}); var sphere = new THREE.Mesh(geometry2, material2); //sphere.receiveShadow = true sphere.castShadow = true var geo = new THREE.PlaneBufferGeometry(2, 2, 1, 1); var mat = new THREE.MeshBasicMaterial({ color: 0x000000, side: THREE.DoubleSide }); var shadowPlane = new THREE.Mesh(geo, mat); shadowPlane.position.x = 4.0; shadowPlane.castShadow = true;
+ 3 other calls in file
GitHub: ASLS-org/studio
10 11 12 13 14 15 16 17 18 19
const planeAxes = axes.substr(0, 2); const geometry = new THREE.PlaneBufferGeometry(2, 2, 1, 1); const material = new THREE.ShaderMaterial({ side: THREE.DoubleSide,
GitHub: 4MOR3/three-background
163 164 165 166 167 168 169 170 171 172
var texture = new THREE.CubeTextureLoader().setPath('nightSky/') .load(['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg']); this.scene.background = texture; }; BasicOceanFactory.prototype.genWater = function () { var waterGeometry = new THREE.PlaneBufferGeometry(100000, 100000); var water = new Water_js_1.Water(waterGeometry, { textureWidth: 512, textureHeight: 512, waterNormals: new THREE.TextureLoader().load('water.jpg', function (texture) {
+ 12 other calls in file
GitHub: onlymg/webgl-react
39 40 41 42 43 44 45 46 47 48
const axes = new THREE.AxesHelper(10); this.scene.add(axes); // add a plane // const planeGeometry = new three.PlaneBufferGeometry(60, 60) // const planeMaterial = new three.MeshStandardMaterial({ color: 0xffffff }) // const plane = new three.Mesh(planeGeometry, planeMaterial) // plane.receiveShadow = true // plane.position.z = 0
GitHub: Cherna/cherna.github.io
49 50 51 52 53 54 55 56 57 58
renderer.setSize(winResWidth, winResHeight); camera.aspect = winResWidth / winResHeight; camera.updateProjectionMatrix(); }); var planeGeometry = new THREE.PlaneBufferGeometry( 50, 50, 100, 100 ); var planeMaterial = new THREE.MeshLambertMaterial({ color: '#aeaeae', side: THREE.DoubleSide });
GitHub: Cherna/cherna.github.io
66 67 68 69 70 71 72 73 74 75
renderer.setSize(winResWidth, winResHeight); camera.aspect = winResWidth / winResHeight; camera.updateProjectionMatrix(); }); var planeGeometry = new THREE.PlaneBufferGeometry(100, 100, 100, 100); var planeMaterial = new THREE.MeshStandardMaterial({ color: '#666', metalness: 0.5, roughness: 0.95,
GitHub: takkasila/SmokeSim3D
122 123 124 125 126 127 128 129 130
} }, vertexShader: require('./glsl/pass-vert.glsl'), fragmentShader: require('./glsl/render-frag.glsl') }) var myPlaneGeo = new THREE.PlaneBufferGeometry(2, 2); var myPlane = new THREE.Mesh(myPlaneGeo, myPlaneMaterial); myPlane.position.set(0, 0, 5); scene.add(myPlane);
GitHub: Siroko/SpringGPU
![Siroko profile picture](/Siroko.png?size=40)
14 15 16 17 18 19 20 21 22
this.sceneRT = new THREE.Scene(); this.sceneBuffer = new THREE.Scene(); this.cameraOrto = new THREE.OrthographicCamera( window.innerWidth / - 2, window.innerWidth / 2, window.innerHeight / 2, window.innerHeight / - 2, 1, 1000 ); this.quad_geom = new THREE.PlaneBufferGeometry( 2, 2, 1, 1 ); this.quad = new THREE.Mesh( this.quad_geom, null ); this.sceneRT.add( this.quad ); };
511 512 513 514 515 516 517 518 519 520 521 522
exports.mesh = undef; exports.init = init; function init() { var geometry = new THREE.PlaneBufferGeometry( 4500, 4500, 10, 10 ); var planeMaterial = new THREE.MeshStandardMaterial( { color: settings.bgColor, roughness: 0.4, metalness: 0.4,
+ 6 other calls in file
three.Vector3 is the most popular function in three (22341 examples)