DebugEnvironment.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import * as THREE from '../../../build/three.module.js';
  2. function DebugEnvironment() {
  3. const envScene = new THREE.Scene();
  4. const geometry = new THREE.BoxGeometry();
  5. geometry.deleteAttribute( 'uv' );
  6. const roomMaterial = new THREE.MeshStandardMaterial( { metalness: 0, side: THREE.BackSide } );
  7. const room = new THREE.Mesh( geometry, roomMaterial );
  8. room.scale.setScalar( 10 );
  9. envScene.add( room );
  10. const mainLight = new THREE.PointLight( 0xffffff, 50, 0, 2 );
  11. envScene.add( mainLight );
  12. const material1 = new THREE.MeshLambertMaterial( { color: 0xff0000, emissive: 0xffffff, emissiveIntensity: 10 } );
  13. const light1 = new THREE.Mesh( geometry, material1 );
  14. light1.position.set( - 5, 2, 0 );
  15. light1.scale.set( 0.1, 1, 1 );
  16. envScene.add( light1 );
  17. const material2 = new THREE.MeshLambertMaterial( { color: 0x00ff00, emissive: 0xffffff, emissiveIntensity: 10 } );
  18. const light2 = new THREE.Mesh( geometry, material2 );
  19. light2.position.set( 0, 5, 0 );
  20. light2.scale.set( 1, 0.1, 1 );
  21. envScene.add( light2 );
  22. const material3 = new THREE.MeshLambertMaterial( { color: 0x0000ff, emissive: 0xffffff, emissiveIntensity: 10 } );
  23. const light3 = new THREE.Mesh( geometry, material3 );
  24. light3.position.set( 2, 1, 5 );
  25. light3.scale.set( 1.5, 2, 0.1 );
  26. envScene.add( light3 );
  27. return envScene;
  28. }
  29. export { DebugEnvironment };