Plan.vue 746 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <template>
  2. <mesh
  3. name="Plane"
  4. :position="position"
  5. :rotation="{
  6. x:deg2rad(rotation.x),
  7. y:deg2rad(rotation.y),
  8. z:deg2rad(rotation.z)
  9. }"
  10. >
  11. <geometry type="PlaneBuffer" :args="[size.w, size.h]" />
  12. <material type="MeshBasic" :color="color" :options="opts" />
  13. </mesh>
  14. </template>
  15. <script>
  16. import mixins from 'components/mixins'
  17. import * as THREE from 'three'
  18. export default {
  19. name: 'Plan',
  20. mixins: [mixins],
  21. props: {
  22. size: Object,
  23. texture: String,
  24. position: Object,
  25. color: Number,
  26. rotation: Object
  27. },
  28. data: () => ({
  29. opts: {
  30. side: THREE.DoubleSide,
  31. wireframe: false,
  32. transparent: true,
  33. opacity: 0.1,
  34. renderOrder: 1
  35. }
  36. })
  37. }
  38. </script>