vue-threejs icon indicating copy to clipboard operation
vue-threejs copied to clipboard

Working with lights

Open alphaCastor-zz opened this issue 6 years ago • 1 comments

Hi. Thank you for this awesome library. I have a question. How can I add additional lights? I want to implement three.js example

p.s. can i somehow get current scene?

alphaCastor-zz avatar Dec 24 '18 17:12 alphaCastor-zz

@alphaCastor

How can I add additional lights?

You can pass :obj prop into components to override like

<light :obj="myLight1"></light>
<light :obj="myLight2"></light>
<light :obj="myLight3"></light>

can i somehow get current scene?

Also, :obj.sync, @update:obj would provide a way to get the obj, like

https://github.com/fritx/vue-threejs/blob/4a44809b006b4f2a2d228019f6264c9324461068/examples/Ocean.vue#L3

<scene :obj.sync="sceneObj"></scene><!-- watch: sceneObj -->

<scene @update:obj="handleSceneObj"></scene>

Cheers! 🍻

fritx avatar Dec 25 '18 04:12 fritx