Spaces:
Running
Running
cutechicken
commited on
Commit
โข
e43a395
1
Parent(s):
3bb416a
Update game.js
Browse files
game.js
CHANGED
@@ -1253,8 +1253,8 @@ class Game {
|
|
1253 |
const tankPos = this.tank.getPosition();
|
1254 |
|
1255 |
// ์นด๋ฉ๋ผ๋ ๋ง์ฐ์ค X ํ์ ์๋ง ๋ฐ๋ผ๊ฐ
|
1256 |
-
const cameraDistance =
|
1257 |
-
const cameraHeight =
|
1258 |
const cameraAngle = this.mouse.x + Math.PI; // ํญ์ ํฌํ์ ๋ค์ชฝ์ ์์น
|
1259 |
|
1260 |
const cameraX = tankPos.x + Math.sin(cameraAngle) * cameraDistance;
|
@@ -1269,7 +1269,7 @@ class Game {
|
|
1269 |
// ์นด๋ฉ๋ผ๊ฐ ํฑํฌ๋ฅผ ๋ฐ๋ผ๋ณด๋๋ก ์ค์
|
1270 |
const lookAtPoint = new THREE.Vector3(
|
1271 |
tankPos.x,
|
1272 |
-
tankPos.y +
|
1273 |
tankPos.z
|
1274 |
);
|
1275 |
this.camera.lookAt(lookAtPoint);
|
|
|
1253 |
const tankPos = this.tank.getPosition();
|
1254 |
|
1255 |
// ์นด๋ฉ๋ผ๋ ๋ง์ฐ์ค X ํ์ ์๋ง ๋ฐ๋ผ๊ฐ
|
1256 |
+
const cameraDistance = 15;
|
1257 |
+
const cameraHeight = 8;
|
1258 |
const cameraAngle = this.mouse.x + Math.PI; // ํญ์ ํฌํ์ ๋ค์ชฝ์ ์์น
|
1259 |
|
1260 |
const cameraX = tankPos.x + Math.sin(cameraAngle) * cameraDistance;
|
|
|
1269 |
// ์นด๋ฉ๋ผ๊ฐ ํฑํฌ๋ฅผ ๋ฐ๋ผ๋ณด๋๋ก ์ค์
|
1270 |
const lookAtPoint = new THREE.Vector3(
|
1271 |
tankPos.x,
|
1272 |
+
tankPos.y + 1,
|
1273 |
tankPos.z
|
1274 |
);
|
1275 |
this.camera.lookAt(lookAtPoint);
|