Lights (wip)
You can easily create the following lights :
AmbientLight(source, threejs doc)DirectionalLight(source, threejs doc)HemisphereLight(source, threejs doc)PointLight(source, threejs doc)RectAreaLight(source, threejs doc)SpotLight(source, threejs doc)
Example :
<PointLight color="#ffffff" :intensity="0.5" />
Common Props (see Light.ts)
| Name | Description | Type | Default |
|---|---|---|---|
castShadow | Casting shadow | Boolean | false |
color | Light color | String, Number | #ffffff |
intensity | Light intensity | Number | 1 |
position | Light position | Object | { x: 0, y: 0, z: 0 } |
shadowMapSize | Shadow map size | Object | { width: 512, height: 512 } |
Access ThreeJS light
You should set a ref on your light :
<PointLight ref="light" />
You can then access ThreeJS light in your component script :
const light = this.$ref.light.light;