cutechicken commited on
Commit
a4bd88b
ยท
verified ยท
1 Parent(s): ca1e346

Update game.js

Browse files
Files changed (1) hide show
  1. game.js +8 -10
game.js CHANGED
@@ -336,8 +336,7 @@ class Game {
336
 
337
  // ํƒœ์–‘๊ด‘ ์„ค์ • - ๊ทธ๋ฆผ์ž ํ’ˆ์งˆ ๋‚ฎ์ถค
338
  const directionalLight = new THREE.DirectionalLight(0xffffff, 1.2);
339
- directionalLight.position.set(0, 300, 0); // ๋” ์œ„์—์„œ ๋น„์ถ”๋„๋ก
340
- directionalLight.intensity = 2.0; // ๊ฐ•๋„ ์ฆ๊ฐ€
341
  directionalLight.castShadow = true;
342
  directionalLight.shadow.mapSize.width = 1024; // ๊ทธ๋ฆผ์ž ํ•ด์ƒ๋„ ๋‚ฎ์ถค
343
  directionalLight.shadow.mapSize.height = 1024;
@@ -352,18 +351,16 @@ class Game {
352
  groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
353
  groundTexture.repeat.set(25, 25); // ํ…์Šค์ฒ˜ ๋ฐ˜๋ณต ํšŸ์ˆ˜ ๊ฐ์†Œ
354
 
355
- // ์‚ฌ๋ง‰ ์žฌ์งˆ ์ตœ์ ํ™”
356
- const groundMaterial = new THREE.MeshStandardMaterial({
357
  map: groundTexture,
358
- color: 0xF4D03F, // ๋” ๋ฐ์€ ๋ชจ๋ž˜์ƒ‰์œผ๋กœ ๋ณ€๊ฒฝ
359
- roughness: 0.7, // ๊ฑฐ์น ๊ธฐ ๊ฐ์†Œ
360
- metalness: 0.0, // ๊ธˆ์†์„ฑ ์ œ๊ฑฐ
361
- bumpScale: 0.2 // ๋ฒ”ํ”„ ํšจ๊ณผ ๊ฐ์†Œ
362
  });
363
 
364
  const ground = new THREE.Mesh(groundGeometry, groundMaterial);
365
  ground.rotation.x = -Math.PI / 2;
366
- ground.receiveShadow = true;
367
 
368
  // ์ง€ํ˜•์˜ ๊ธฐ๋ณต ์ถ”๊ฐ€ (๋‹จ์ˆœํ™”)
369
  const vertices = ground.geometry.attributes.position.array;
@@ -371,7 +368,8 @@ class Game {
371
  for (let i = 0; i < vertices.length; i += 3) {
372
  const x = vertices[i] / 100;
373
  const y = vertices[i + 1] / 100;
374
- vertices[i + 2] = (Math.sin(x + seed) * Math.cos(y + seed) * 0.3); // ๋†’์ด๋ฅผ 0.3๋ฐฐ๋กœ ์ค„์ž„
 
375
  }
376
  ground.geometry.attributes.position.needsUpdate = true;
377
  ground.geometry.computeVertexNormals();
 
336
 
337
  // ํƒœ์–‘๊ด‘ ์„ค์ • - ๊ทธ๋ฆผ์ž ํ’ˆ์งˆ ๋‚ฎ์ถค
338
  const directionalLight = new THREE.DirectionalLight(0xffffff, 1.2);
339
+ directionalLight.position.set(100, 100, 50);
 
340
  directionalLight.castShadow = true;
341
  directionalLight.shadow.mapSize.width = 1024; // ๊ทธ๋ฆผ์ž ํ•ด์ƒ๋„ ๋‚ฎ์ถค
342
  directionalLight.shadow.mapSize.height = 1024;
 
351
  groundTexture.wrapS = groundTexture.wrapT = THREE.RepeatWrapping;
352
  groundTexture.repeat.set(25, 25); // ํ…์Šค์ฒ˜ ๋ฐ˜๋ณต ํšŸ์ˆ˜ ๊ฐ์†Œ
353
 
354
+ // ์‚ฌ๋ง‰ ์žฌ์งˆ ์ตœ์ ํ™” - MeshLambertMaterial ์‚ฌ์šฉ
355
+ const groundMaterial = new THREE.MeshLambertMaterial({
356
  map: groundTexture,
357
+ color: 0xF4D03F, // ๋ฐ์€ ๋ชจ๋ž˜์ƒ‰
358
+ emissive: 0x222222 // ์•ฝ๊ฐ„์˜ ์ž์ฒด ๋ฐœ๊ด‘ ์ถ”๊ฐ€
 
 
359
  });
360
 
361
  const ground = new THREE.Mesh(groundGeometry, groundMaterial);
362
  ground.rotation.x = -Math.PI / 2;
363
+ ground.receiveShadow = false; // ๊ทธ๋ฆผ์ž ๋ฐ›์ง€ ์•Š๋„๋ก ์„ค์ •
364
 
365
  // ์ง€ํ˜•์˜ ๊ธฐ๋ณต ์ถ”๊ฐ€ (๋‹จ์ˆœํ™”)
366
  const vertices = ground.geometry.attributes.position.array;
 
368
  for (let i = 0; i < vertices.length; i += 3) {
369
  const x = vertices[i] / 100;
370
  const y = vertices[i + 1] / 100;
371
+ vertices[i + 2] =
372
+ (Math.sin(x + seed) * Math.cos(y + seed) * 1.0);
373
  }
374
  ground.geometry.attributes.position.needsUpdate = true;
375
  ground.geometry.computeVertexNormals();