simple import
This commit is contained in:
parent
95c0bcdd10
commit
a508a3710f
@ -19,8 +19,7 @@
|
|||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"three": "https://unpkg.com/three@0.152.2/build/three.module.js",
|
"three": "https://unpkg.com/three@0.152.2/build/three.module.js",
|
||||||
"three/addons/": "https://unpkg.com/three@0.152.2/examples/jsm/",
|
"three/addons/": "https://unpkg.com/three@0.152.2/examples/jsm/"
|
||||||
"MazeMesh": "./MazeMesh.js"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
10
main.js
10
main.js
@ -12,7 +12,7 @@ import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
|
|||||||
import { Water } from 'three/addons/objects/Water.js';
|
import { Water } from 'three/addons/objects/Water.js';
|
||||||
import { Sky } from 'three/addons/objects/Sky.js';
|
import { Sky } from 'three/addons/objects/Sky.js';
|
||||||
|
|
||||||
import { MazeMesh } from 'MazeMesh';
|
import { MazeMesh } from './MazeMesh.js';
|
||||||
|
|
||||||
const latitude = THREE.MathUtils.degToRad(35)
|
const latitude = THREE.MathUtils.degToRad(35)
|
||||||
const longitude = THREE.MathUtils.degToRad(25)
|
const longitude = THREE.MathUtils.degToRad(25)
|
||||||
@ -74,7 +74,7 @@ const ocean = new Water(
|
|||||||
alpha : 0.7
|
alpha : 0.7
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
ocean.rotation.x = - Math.PI / 2;
|
ocean.rotation.x = - Math.PI * 0.5;
|
||||||
ocean.position.y = -.01
|
ocean.position.y = -.01
|
||||||
ocean.receiveShadow = true;
|
ocean.receiveShadow = true;
|
||||||
ocean.material.transparent = true;
|
ocean.material.transparent = true;
|
||||||
@ -553,9 +553,9 @@ function animate() {
|
|||||||
const time = clock.elapsedTime;
|
const time = clock.elapsedTime;
|
||||||
|
|
||||||
ocean.material.uniforms[ 'time' ].value += 1.0 / 100.0;
|
ocean.material.uniforms[ 'time' ].value += 1.0 / 100.0;
|
||||||
raft.rotation.z = 0.12 * Math.cos( 1.2 * time )
|
raft.rotation.z = 0.06 * Math.cos( 1.1 * time )
|
||||||
raft.rotation.x = 0.06 * Math.cos( time )
|
raft.rotation.x = 0.05 * Math.cos( 1.0 * time )
|
||||||
raft.position.y = 0.05 * (0.5 * Math.sin( 1.2 * time ) + 0.5 * Math.sin( time ))
|
raft.position.y = 0.03 * (0.6 * Math.sin( 1.1 * time ) + 0.5 * Math.sin( 1.0 * time ))
|
||||||
|
|
||||||
if ( sunLight.visible ) {
|
if ( sunLight.visible ) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user