How to set imported .glb file transparency off in react-babylon

Hi,

I am using React-babylon js.

  1. Can you please let me know how can we set transparency off or may be able to toggle the transparency of any imported .glb file model.

  2. How can we resist any mesh or box entrance in the imported mesh (.glb). I have tried with couple of answers given in the forum itself like checkCollision = true in the box and in the scene but not working. Do we have any other property that might do the work.?


Hello and welcome to the Babylon community!
cc @BabylonNative about the transparency issue

About collisions, you can manually check for mesh intersections: Mesh Intersections | Babylon.js Documentation (babylonjs.com) or use physics: Using A Physics Engine | Babylon.js Documentation (babylonjs.com). checkCollisions only checks for collisions from the camera.

Hi @Pawan_yadav
Are you having issues with Babylon React Native or with Babylon.js with React framework ?

It doesn’t seem like this question has much to do with react, so if you can reproduce the problem in a Babylon.js playground, that would be helpful.

I am using React framework with Babylon.js

sure, I will try to add Babylon.js playground link.

1 Like

Hi, I have tried with one of available physics engine in document , Havok, But in my case I am using Babylon version 4.2.1. And I think Havok plugin is not available by default in my current version of babylon.js?

  1. Looks like you are on a different render group, since car is not occluding.
  2. You might be able to solve that how validateDrag works on the gizmos by comparing each bounding box. That would be an quick comparison for overlap. There is a boundingInfo property returned in the model loaded callback (if you are using react-babylonjs and it sounds like you are - it’s returned on the hook and the Model component).

Yes, Havok is supported for version 6.0 and up only. We have a legacy physics documentation with the engines that work in 4.2

Hi, Thanks, now I am able to detect intersection between meshes. But could you please give some guidance on How can we handle transparency of model?

I’d suggest starting a new question and supplying sample models in a PG. As I mentioned it looks like you have done something with rendering groups to bypass expected occlusion.

3 Likes