function buildScene() { const scene = new THREE.Scene(); scene.background = new THREE.Color("#FFF"); return scene; }
constructor(props) { super(props); this.state = {}; this.animate = this.animate.bind(this); this.scene = new THREE.Scene(); this.camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); this.camera.position.set( 0, 0, 60 ); this.renderer = new THREE.WebGLRenderer(); this.renderer.setSize( window.innerWidth, window.innerHeight ); }
componentDidMount() { const width = this.mount.clientWidth; const height = this.mount.clientHeight; this.scene = new THREE.Scene(); this.camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000); this.renderer = new THREE.WebGLRenderer({ antialias: true }); this.loader = new GLTFLoader(); this.controls = new OrbitControls(this.camera, this.renderer.domElement); // Add a light source!!! // const light = new THREE.HemisphereLight(0xffffbb, 0x080820, 1); this.scene.add(light); this.camera.position.z = 2; this.camera.position.y = 0.7; this.camera.position.x = 0.7; this.loadModel(); this.renderer.setSize(width, height); window.addEventListener('resize', this.handleResize); this.mount.appendChild(this.renderer.domElement); this.init(); }
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(); }
this.scene = new THREE.Scene();
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 ); }
this.animate = this.animate.bind(this); this.scene = new t3.Scene(); this.camera = new t3.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); this.renderer = new t3.WebGLRenderer();
componentDidMount() { var scene = new THREE.Scene(); var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 ); var renderer = new THREE.WebGLRenderer();
this.scene = new THREE.Scene(); this.scene.fog = new THREE.FogExp2(Config.fog.color, Config.fog.near);
scene = new THREE.Scene();
scene = new THREE.Scene();
this.scene = new THREE.Scene() this.scene.background = new THREE.Color(BACKGROUND_CONFIG.color) this.scene.fog = new THREE.Fog(
this.scene = new THREE.Scene(); this.camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
scene = new THREE.Scene();