This commit is contained in:
nicomacbookpro
2025-09-02 09:44:04 +08:00
2 changed files with 2 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import * as THREE from 'three';
import { Water } from 'three/examples/jsm/objects/Water.js';
import normal from './waternormals.jpg?url';
const waterGeometry = new THREE.PlaneGeometry(50, 50);
const ocean = new Water(
@@ -8,7 +8,7 @@ const ocean = new Water(
{
textureWidth: 512,
textureHeight: 512,
waterNormals: new THREE.TextureLoader().load(`https://z2586300277.github.io/3d-file-server/images/texture/waternormals.jpg`, function (texture) {
waterNormals: new THREE.TextureLoader().load(normal, function (texture) {
texture.wrapS = texture.wrapT = THREE.RepeatWrapping;
}),
sunDirection: new THREE.Vector3(0, 1, 0), // 设置太阳方向为垂直向下

BIN
src/utils/waternormals.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB