mirror of
https://github.com/haselkern/Minecraft-ArmorStand.git
synced 2025-05-17 15:05:33 +00:00
Rotating head demo
This commit is contained in:
parent
11eec45515
commit
608fce96cc
2 changed files with 20 additions and 16 deletions
22
src/App.vue
22
src/App.vue
|
@ -8,7 +8,7 @@
|
|||
<camera :obj="camera"></camera>
|
||||
<light :hex="0xFFFFFF" :position="{x: 100, y: 200, z: 300}"></light>
|
||||
</orbit-controls>
|
||||
<armorstand></armorstand>
|
||||
<armorstand :pose="pose"></armorstand>
|
||||
</scene>
|
||||
</renderer>
|
||||
</div>
|
||||
|
@ -30,6 +30,7 @@
|
|||
</card>
|
||||
<card>
|
||||
<h1 class="text-xl">Pose</h1>
|
||||
<!-- TODO modularize sliders -->
|
||||
<table class="w-full">
|
||||
<tr>
|
||||
<td>Rotation</td>
|
||||
|
@ -37,9 +38,9 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Head</td>
|
||||
<td><input v-model="rotation.x" class="w-full" type="range" min="0" max="360"></td>
|
||||
<td><input v-model="rotation.y" class="w-full" type="range" min="0" max="360"></td>
|
||||
<td><input v-model="rotation.z" class="w-full" type="range" min="0" max="360"></td>
|
||||
<td><input v-model="pose.head.x" class="w-full" type="range" min="0" max="360"></td>
|
||||
<td><input v-model="pose.head.y" class="w-full" type="range" min="0" max="360"></td>
|
||||
<td><input v-model="pose.head.z" class="w-full" type="range" min="0" max="360"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</card>
|
||||
|
@ -59,7 +60,9 @@ export default {
|
|||
renderer: new THREE.WebGLRenderer({alpha: true, antialias: true}),
|
||||
camera: new THREE.PerspectiveCamera(70, 400 / 400, 0.1, 100),
|
||||
ambientLight: new THREE.AmbientLight(0x333333),
|
||||
rotation: {x: 30, y: 40, z: 0},
|
||||
pose: {
|
||||
head: {x: 0, y: 0, z: 0},
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -76,14 +79,5 @@ export default {
|
|||
this.renderer.setSize(w, h);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
rotationInRad() {
|
||||
return {
|
||||
x: this.rotation.x/180*Math.PI,
|
||||
y: this.rotation.y/180*Math.PI,
|
||||
z: this.rotation.z/180*Math.PI,
|
||||
};
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue