Transform
-
[Three.JS] 그룹 안에 오브젝트 추가해서 씬에 넣기Three.JS 2023. 12. 27. 14:03
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 group으로 그룹생성 scene.add(group) scene.add로 그룹을 씬에 추가 const cube1=new THREE.Mesh( new Three.BoxGeometry(1,1,1), new Three.MeshBasicMaterial({ color : 0xff0000 }) ) group.add(cube1) 결과 이제 큐브2를 추가해봄 const cube2 = new THREE...
-
[Three.JS] Transform (Scale, Position, Rotate) 과 Quarternion, lookat카테고리 없음 2023. 12. 27. 10:58
//Scale mesh.scale.x =2 mesh.scale.y=0.5 mesh.scale.z=0.5 오브젝트의 크기를 조절하는것 scale 이렇게하거나 mesh.scale.set(2,0.5,0.5) 이렇게 한번에 set으로 한줄로 설정해도됨 x는 좌우로움직이고 y는 위아래로 z는 앞뒤로움직임. 뭔가 ㅇㄹㄷㅅ 때 움직이는 그 좌표값이네..? 블렌더는 z가 위아래, y가 앞뒤인것이 다르다 하지만 이것은 직접 설정해서 바꿀수있다고함 뭐야 더어렵자나요.. 그냥 외울래요.. mesh.position.x=0.7 mesh.position.y=-0.6 mesh.position.z=1 포지션역시 이렇게하거나 mesh.position.set(0.7, -0.6, 1) 이렇게 둘다가능한~~ 로테이션은 PI를 응용할수있다 ..