render(scene, camera) { // Renders scene to canvas target this.threeRenderer.render(scene, camera) }
componentDidMount() { // this.mount.appendChild( WEBVR.createButton(this.renderer)); this.renderer.vr.enabled = true; this.renderer.setAnimationLoop(() => { this.renderer.render(this.scene, this.camera); }); }
function update() { cube.rotation.x += 0.01; cube.rotation.y += 0.01; renderer.render(scene, camera); if(idx > 0) { encoder.addFrame(canvas.__ctx__); console.log(`add frame ${idx}`); } idx++; if(idx < 300) { setTimeout(update, 16); } }
animate() { this.renderer.render( this.scene, this.camera ); if (this.mixer != null) { this.mixer.update(2); } requestAnimationFrame( this.animate ); }
function update() { const elapsedTime = clock.getElapsedTime(); for(let i=0; i<sceneSubjects.length; i++) sceneSubjects[i].update(elapsedTime); updateCameraPositionRelativeToMouse(); renderer.render(scene, camera); }
constructor(props) { super(props); this.state = {}; this.scene = new t3.Scene(); this.camera = new t3.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); this.camera.position.set( 0, 0, 100 ); this.camera.lookAt( 0, 0, 0 ); this.renderer = new t3.WebGLRenderer(); this.renderer.setSize( window.innerWidth, window.innerHeight ); // Load the Orbitcontroller // eslint-disable-next-line var controls = new OrbitControls(this.camera, this.renderer.domElement ); const material = new t3.LineBasicMaterial( { color: 0xff0000} ); const geometry = new t3.Geometry(); geometry.vertices.push(new t3.Vector3( -10, 0, 0) ); geometry.vertices.push(new t3.Vector3( 0, 10, 0) ); geometry.vertices.push(new t3.Vector3( 10, 0, 0) ); var line = new t3.Line( geometry, material ); this.scene.add( line ); this.renderer.render( this.scene, this.camera ); }
render(gl, viewProjectionMatrix) { this.viewProjectionMatrix = viewProjectionMatrix; const l = new THREE.Matrix4().fromArray(viewProjectionMatrix); this.renderer.state.reset(); // The root tile transform is applied to the camera while rendering // instead of to the root tile. This avoids precision errors. this.camera.projectionMatrix = l.multiply(this.rootTransform); this.renderer.render(this.scene, this.camera); if (this.loadStatus === 1) { // first render after root tile is loaded this.loadStatus = 2; const frustum = new THREE.Frustum(); frustum.setFromMatrix( new THREE.Matrix4().multiplyMatrices( this.camera.projectionMatrix, this.camera.matrixWorldInverse ) ); if (this.tileset) { this.tileset.update(frustum, this._getCameraPosition()); } } }
constructor(props) { super(props); this.state = {}; this.scene = new t3.Scene(); this.camera = new t3.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); this.renderer = new t3.WebGLRenderer(); this.renderer.setSize( window.innerWidth, window.innerHeight ); // Load the Orbitcontroller // eslint-disable-next-line var controls = new OrbitControls(this.camera, this.renderer.domElement ); const geometry = new t3.BoxGeometry( 4, 1 , 1); const material = new t3.MeshBasicMaterial( { color: 0x00ff00, wireframe: true } ); this.cube = new t3.Mesh( geometry, material ); this.scene.add( this.cube ); this.camera.position.z = 5; const animate = () => { requestAnimationFrame( animate ); this.cube.rotation.x += 0.01; this.cube.rotation.y += 0.01; this.renderer.render( this.scene, this.camera ); }; animate(); }
animate() { // this.controls.update(); for(let d = 0; d < this.decorations.length; d++) { this.decorations[d].updatePosition(); } this.renderer.render(this.scene, this.camera); requestAnimationFrame(this.animate); }
this.renderer.render( this.scene, this.camera ); };
lathe.rotation.x -= 0.005; lathe.rotation.y -= 0.005; renderer.render( scene, camera ); }; animate();
gltf.scene.position.y -= 10; this.scene.add( gltf.scene ); this.renderer.render( this.scene, this.camera ); });
animate() { this.renderer.render( this.scene, this.camera ); if (this.mixer != null) { this.mixer.update(2); } requestAnimationFrame( this.animate ); }
render(scene, camera) { // Renders scene to canvas target this.threeRenderer.render(scene, camera); }