Plan.vue 825 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. :options="mesh_opts"
  11. >
  12. <geometry type="PlaneBuffer" :args="[size.w, size.h]" />
  13. <material type="MeshLambert" :color="color" :options="opts" />
  14. </mesh>
  15. </template>
  16. <script>
  17. import mixins from 'components/mixins'
  18. import * as THREE from 'three'
  19. export default {
  20. name: 'Plan',
  21. mixins: [mixins],
  22. props: {
  23. size: Object,
  24. texture: String,
  25. position: Object,
  26. color: Number,
  27. rotation: Object
  28. },
  29. data: () => ({
  30. mesh_opts: {
  31. receiveShadow: true,
  32. castShadow: true
  33. },
  34. opts: {
  35. side: THREE.DoubleSide,
  36. wireframe: false,
  37. transparent: true,
  38. opacity: 0.4
  39. }
  40. })
  41. }
  42. </script>