Meshes

You can easily create mesh :

<Box :size="1" :position="{ x: 10, y: 0, z: 0 }">
  <BasicMaterial />
</Box>

You can use the following meshes :

Common Props (see Mesh.ts)

NameDescriptionTypeDefault
positionPositionObject{ x: 0, y: 0, z: 0 }
rotationRotationObject{ x: 0, y: 0, z: 0 }
scaleScaleObject{ x: 1, y: 1, z: 1 }
castShadowCast shadow ?Booleanfalse
receiveShadowReceive shadow ?Booleanfalse

To enable shadows, please read Shadows.

Example :

<Box
  :position="{ x: 0, y: 0, z: 0 }"
  :rotation="{ x: 0, y: 0, z: 0 }"
  :scale="{ x: 1, y: 1, z: 1 }"
  :cast-shadow="false"
  :receive-shadow="false"
>
  <BasicMaterial />
</Box>

Access ThreeJS mesh

You should set a ref on your mesh :

<Box ref="box" />

You can then access ThreeJS mesh in your component script :

const mesh = this.$ref.box.mesh;