When I test my 3d model in https://gltf-viewer.donmccurdy.com/ I find no issues but within 8thwall (aframe) the part of the 3d model seems to hide or disappear abruptly. Can anyone tell me the cause of it?
Link to recorded video
8thWall
GLTF Viewer
To fix this please add this code to your app.js
AFRAME.registerComponent('no-cull', {
init() {
this.el.addEventListener('model-loaded', () => {
this.el.object3D.traverse(obj => obj.frustumCulled = false)
})
},
})
then add it to the entity that is clipping
you can reference it in the sample project here:
The camera in your case is culling your 3D model.
Hiya Vaibhav,
The model is getting culled out of the view - itβs a common issue with models animated using skinning ( the bounding box that gets used for culling the model doesnβt always match up with the visual version )
Paste this code into no-cull.js
const noCullComponent = {
init() {
this.el.addEventListener('model-loaded', () => {
this.el.object3D.traverse(
(obj) => {
if(obj.isSkinnedMesh)
{
obj.frustumCulled = false
}
}
)
})
},
}
export {noCullComponent}
In app.js, add these lines to register the componentβ¦
import {noCullComponent} from './no-cull'
AFRAME.registerComponent('no-cull', noCullComponent)
Then, add no-cull to the <a-entity that references the skinned character, and it wonβt be culled by the camera / disappear.
eg
<a-entity
id="main-character"
gltf-model="#main-character-src"
no-cull
>
</a-entity>
@Ian it looks like we were both answering that at the same time, you beat me by a minute
Apologies for the late reply. Thanks, @Ian & @Mal_Duffin for the help your solutions worked perfectly.