Skip to content

Setting shadows using GLTFModel #484

Answered by JaimeTorrealba
greegus asked this question in Q&A
Discussion options

You must be logged in to vote

Right now we have to add the reference, Then use the (Traverse)[https://threejs.org/docs/index.html?q=object#api/en/core/Object3D.traverse] function to tell all the meshes to add cast-shadow.
Something like:

<script setup> const myModelRef = shallowRef() watch(myModelRef , value => { console.log(value) //here you have to see the structure of your model to apply traverse }) </script>

But this seems like a big opportunity to improve how the GLTFModel works, we could add a issue on cientos if you agree

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by greegus
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@greegus
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants