- position
- scale
- rotation
- quaternion - ํ์ ๊ณผ ๊ด๋ จ๋ ์์ฑ (ํ์ ์์ธํ ๋ค๋ฃธ)
All classes that inherit from the Object3D like PerspectiveCamera or Mesh has thos props.

mesh.position.x = 0.7;
mesh.position.y = - 0.6;
mesh.position.z = 1;
// set์ x,y,z ํ ๋ฒ์ ์ค์ ํ๋ ๋ฉ์๋, Vector3์ด๋ฏ๋ก ์ง์ ๊ฐ๋ฅ
mesh.position.set(0.7, -0.6, 1);

// nomarlize()๋ ๋ฐฉํฅ์ ์ ์งํ๋ฉด์ length๋ฅผ 1๋ก ์ค์ ํ๋ ๋ฉ์๋
mesh.position.normalize();
// length()๋ (0, 0, 0)๋ถํฐ, ์ , ํน์ mesh๊น์ง์ ๊ฑฐ๋ฆฌ
console.log(mesh.position.length())

// mesh์ object์ ๊ฑฐ๋ฆฌ distanceTo()
console.log(mesh.position.distanceTo(camera.position))

// Axes helper
const axesHelper = new THREE.AxesHelper();
scene.add(axesHelper);

์ด๋ฏธ์ง์ z์ถ์ด ๋ณด์ด์ง ์๋ ์ด์ ๋ ์นด๋ฉ๋ผ ๊ธฐ์ค it's moving forward "straight"
camera.position.set(1, 1, 4); // ๋ก ์ค์ ํด์ฃผ๋ฉด...

scale ๋ํ Vector3์ ์ธ์คํด์ค์ด๋ฏ๋ก any arbitrary triplet of nums
์์๊ฐ์ ์ฌ์ฉํด๋ ๋์ง๋ง, ์ถ์ด logical direction์ ์์นํ์ง ์๊ฒ ๋๊ณ , ์ด๋ก ์ธํด ๋์ค์ ๋ฒ๊ทธ๊ฐ ๋ฐ์ํ ์ ์์ผ๋ฏ๋ก ์ฌ์ฉ์ ์ง์ํ๋ ํธ์ด ์ข์
// Scale
mesh.scale.x = 2;
mesh.scale.y = 0.5;
mesh.scale.z = 0.5;
mesh.scale.set(2, 0.5, 0.5)

rotate๋ ๋ ๊ฐ์ง ๋ฐฉ๋ฒ์ด ์์
rotationquaternion๋จ์๋ ๋ผ๋์์ ์ฌ์ฉํ๋ฏ๋ก Math.PI๋ฅผ ์ด์ฉ
// Rotation
mesh.rotation.x = Math.PI * 0.25;
mesh.rotation.y = Math.PI * 0.25;
์ฃผ์ : x์ถ์ ํ์ ํ๋ฉด ๋ค๋ฅธ ์ถ์ ๋ฐฉํฅ๋ ๋์์ ๋ณํจ

์ถ์ ์๋ก ์ํฅ์ ๋ฐ์ ์ ๋ฐ์ ์์ด์gimbal lock ๋ฐ์ ๊ฐ๋ฅ (์ถ์ด ๋ค๋ฅธ ์ถ์ ์ํฅ ๋ฐ์์)
์ด๋ด ๋๋ ์ถ ์ ์ฉ ์์๋ฅผ ์ง์ ํด์ฃผ๋ฉด ๋๋ค
์ฃผ์ : reorder ๋จผ์
// Rotation
mesh.rotation.reorder('YXZ')
mesh.rotation.x = Math.PI * 0.25;
mesh.rotation.y = Math.PI * 0.25;

Euler is easy to understand but this axid order can be problematic. This is why most engine sand 3D S/W use Quaternion
also expressess a rotation, but in more ์ํ์ ๋ฐฉ๋ฒ
์๋ก ์ ๋ฐ์ดํธ
Quaternionupdates ->rotation
rotationupdates ->Quaternion
lookAt(...) method rotates the obj. so that its
-zfaces thetargetyou provided.targetmust be a Vector3
์ด ๋ฉ์๋๋ฅผ ํตํด ์นด๋ฉ๋ผ๊ฐ ์ด๋ค obj๋ฅผ ๋ฐ๋ผ๋ณด๋๋ก ํด์ค ์ ์๋ค.
ex. ๊ฒ์์์ ํ๋ ์ด์ด๊ฐ ์ด๋ค ๋ฌผ์ฒด ๋ฐ๋ผ๋ณด๋ ์์
์ธ์๋ก Vector3๋ฅผ ๋ฐ๋๋ค
// ์กฐ๊ธ ๋ฌด์ํ ๋ฐฉ์
camera.lookAt(new THREE.Vector3(3, 0, 0));
// posiotion๋ vector3์ด๋ฏ๋ก
camera.lookAt(mesh.position);

you can put objs inside groups and use
position,rotation(or quaternion), andscaleon those groups. To do this, use the Group class
Group์ผ๋ก ๋ฌถ๋ ์ต๊ด ๋ค์ด๊ธฐ!
const group = new THREE.Group();
scene.add(group);
const cube1 = new THREE.Mesh(
new THREE.BoxGeometry(1, 1, 1),
new THREE.MeshBasicMaterial({ color: 0xff0000 }),
);
group.add(cube1)
const cube2 = new THREE.Mesh(
new THREE.BoxGeometry(1, 1, 1),
new THREE.MeshBasicMaterial({ color: 0x00ff00 }),
);
cube2.position.x = -2;
group.add(cube2)
const cube3 = new THREE.Mesh(
new THREE.BoxGeometry(1, 1, 1),
new THREE.MeshBasicMaterial({ color: 0x0000ff }),
);
cube3.position.x = 2;
group.add(cube3)

group.position.y = 1;

group.position.y = 1;
group.scale.y = 2;

group.position.y = 1;
group.scale.y = 2;
group.rotation.y = 1;


์ฐธ๊ณ :
9rganizedChaos๋ ๋ฒจ๋ก๊ทธ