Transformando objetos 2 Flashcards

1
Q

Como definir a posição de um objeto em Three.js usando um único método?

A

mesh.position.set(x, y, z)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Qual classe representa position, scale e permite métodos como normalize() e distanceTo()?

A

THREE.Vector3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Como acessar o valor de rotação no eixo X?

A

mesh.rotation.x

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Como rotacionar um objeto 45 graus no eixo Y?

A

mesh.rotation.y = Math.PI * 0.25

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Como inverter a escala de um objeto no eixo Y?

A

mesh.scale.y = -1

não recomendado, pode causar bugs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Qual a forma correta de aplicar múltiplas transformações ao mesmo tempo?

A

Usando múltiplas chamadas:

mesh.position.set(…)
mesh.scale.set(…)
mesh.rotation.set(…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Como mudar a ordem de aplicação das rotações?

A

mesh.rotation.reorder(‘YXZ’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Como fazer um objeto olhar para uma posição específica?

A

mesh.lookAt(new THREE.Vector3(x, y, z))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Como agrupar vários objetos para aplicar transformações em todos de uma vez?

A

const group = new THREE.Group()
group.add(mesh1)
group.add(mesh2)
scene.add(group)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Como criar um helper visual que mostra os eixos x, y e z?

A

const axesHelper = new THREE.AxesHelper(size)
scene.add(axesHelper)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Como duplicar uma mesh e posicioná-la ao lado de outra no eixo X?

A

const cube2 = mesh.clone()
cube2.position.x = 2
scene.add(cube2)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly