diff --git a/system/cannon-es b/system/cannon-es new file mode 160000 index 0000000..4512d3f --- /dev/null +++ b/system/cannon-es @@ -0,0 +1 @@ +Subproject commit 4512d3fc3f531a64972a2cbd3979bc2f84dfc24f diff --git a/system/csv/getCSV.csv b/system/csv/getCSV.csv index 326f128..9b9456c 100644 --- a/system/csv/getCSV.csv +++ b/system/csv/getCSV.csv @@ -1,3 +1,2 @@ datePath,loc.X,loc.Y,loc.Z -../model/cube.glb,15,0,0 -../model/cube1.glb,25,0,0 \ No newline at end of file +../model/tenrankai.glb,0,0,0 \ No newline at end of file diff --git a/system/model/tenrankai.glb b/system/model/tenrankai.glb new file mode 100644 index 0000000..f933764 --- /dev/null +++ b/system/model/tenrankai.glb Binary files differ diff --git a/system/test/object_from_csv.html b/system/test/object_from_csv.html index d202f9a..a4aa68c 100644 --- a/system/test/object_from_csv.html +++ b/system/test/object_from_csv.html @@ -48,16 +48,21 @@ 1000 ); //カメラセット - camera.position.set(10, 50, 50); // カメラの位置 + camera.position.set(52, 10, -53); // カメラの位置 camera.lookAt(new THREE.Vector3(0, 5, 0)); //ライトの作成 - const light = new THREE.SpotLight(0xffffff, 1.0); - light.position.set(100, 500, 500); + const light = new THREE.PointLight(0xffffff, 1, 100); + light.position.set(52, 10, -53); + light.position.set(52, 44, -44) scene.add(light); light.castShadow = true; console.log(light); + function update() { + light.position.copy(camera.position); + } + // 補助線 const axesHelper = new THREE.AxesHelper(500); //red is x, green is y, blue is z scene.add(axesHelper); @@ -155,62 +160,6 @@ }); } - // glbLoader("../model/tohokukoeki_univ.glb",0,0,0) - - // // fbxファイルの読み込み - // clock = new THREE.Clock(); - // //fbxファイルの読み込み - // const loader = new FBXLoader(); - - // loader.load("model/box_move.fbx", function (object) { - // object.scale.set(0.01, 0.01, 0.01); - // object.position.set(0, 1, 0); - // mixer = new THREE.AnimationMixer(object); - // let action = mixer.clipAction(object.animations[0]); - // action.play(); - // scene.add(object); - // }); - - // // ビデオテクスチャの作成 - // const video = document.createElement("video"); - // video.src = "video/OkinawaSea.mp4"; - // video.src = "video/OkinawaSea.webm"; - // video.autoplay = true; - // video.loop = true; - // video.muted = true; - // video.load(); - // video.play(); - // const texture = new THREE.VideoTexture(video); - // // 動画の表示されているオブジェクトをなめらかにする。 - // texture.minFilter = THREE.LinearFilter; - // texture.magFilter = THREE.LinearFilter; - // texture.wrapS = THREE.ClampToEdgeWrapping; - // texture.wrapT = THREE.ClampToEdgeWrapping; - // // ------------------------------------------------ - // const textureMaterial = new THREE.MeshBasicMaterial({ map: texture }); - // const textureGeometry = new THREE.PlaneGeometry(12, 8); - // const mesh = new THREE.Mesh(textureGeometry, textureMaterial); - // mesh.position.set(0, 5, 0); - // scene.add(mesh); - - // // オーディオの作成 - // const listener = new THREE.AudioListener(); - // camera.add(listener); - // const audioGeometry = new THREE.BoxGeometry(100, 100, 100); - // const audioMaterial = new THREE.MeshBasicMaterial({ color: 0xffffff }); - // const cube = new THREE.Mesh(audioGeometry, audioMaterial); - // scene.add(cube); - // const audioLoader = new THREE.AudioLoader(); - // const positionalAudio = new THREE.PositionalAudio(listener); - - // audioLoader.load("./mp3/OkinawaSea.mp3", function (buffer) { - // positionalAudio.setBuffer(buffer); - // positionalAudio.setRefDistance(100); - // positionalAudio.play(); - // positionalAudio.setLoop(true); - // }); - // cube.add(positionalAudio); - document .getElementById("WebGL-output") .appendChild(renderer.domElement); @@ -221,6 +170,7 @@ const speed = 10; // 移動速度 const direction = new THREE.Vector3(); const { x, y, z } = controls.getObject().position; + console.log(x, y, z); direction.x = Number(moveRight) - Number(moveLeft); direction.z = Number(moveBackward) - Number(moveForward); direction.normalize(); @@ -232,6 +182,7 @@ function animate() { requestAnimationFrame(animate); updateCameraPosition(); + // update(); if (mixer) mixer.update(clock.getDelta()); renderer.render(scene, camera); }