Compare commits

...

3 Commits

Author SHA1 Message Date
6c9fed62b0 less light 2023-06-28 03:21:32 +02:00
51ac2cf0f0 raft world octree 2023-06-28 03:02:53 +02:00
6b5760ac3f format 2023-06-28 02:51:24 +02:00

View File

@ -82,6 +82,8 @@ scene.background = new THREE.CubeTextureLoader()
'lf.jpg', 'lf.jpg',
] ); ] );
window.scene = scene
const camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 1000); const camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.1, 1000);
camera.rotation.order = 'YXZ'; camera.rotation.order = 'YXZ';
@ -259,10 +261,10 @@ const sun = new THREE.Vector3();
// Lights // Lights
const ambientLight = new THREE.AmbientLight(0x404040, 9); const ambientLight = new THREE.AmbientLight(0x404040, 7);
scene.add(ambientLight); scene.add(ambientLight);
const sunLight = new THREE.DirectionalLight(0xfffae8, 0.7); const sunLight = new THREE.DirectionalLight(0xfffae8, 0.5);
sunLight.castShadow = true; sunLight.castShadow = true;
sunLight.shadow.camera.near = 0.1; sunLight.shadow.camera.near = 0.1;
sunLight.shadow.camera.far = 1.4 * mazeWidth; sunLight.shadow.camera.far = 1.4 * mazeWidth;
@ -338,10 +340,10 @@ const raft = new THREE.Mesh(raftGeometry, [
raft.position.set( .2, ocean.position.y, -mazeWidth/2 - 1 ); raft.position.set( .2, ocean.position.y, -mazeWidth/2 - 1 );
raft.rotation.y = 1.4 raft.rotation.y = 1.4
raft.castShadow = true; raft.castShadow = true;
collisionner.add(raft); collisionner.add(raft);
const raftOctree = new Octree(); const raftOctree = new Octree();
raftOctree.fromGraphNode(raft) raftOctree.fromGraphNode(raft)
scene.add(raft)
scene.add(collisionner); scene.add(collisionner);