Jmonkeyengine GLTF Asset Handling Vs Godot 4. Am I Doing Something Wrong?

I tried importing different Assets in JME 3.7 SDK. I have issues with the weapon when I rotate camera up the pistol model totally hides. And Rifle Scope and Mag also does the same when viewed from different angle. I have tried other simple models, they are working fine.

I also tried camera settings.

float nearClipping = 0.01f; // A small value like 0.1 is common
float farClipping = 500.0f; // A value that fits the scale of your scene

    this.cam .setFrustumPerspective(70, (float) cam.getWidth() / cam.getHeight(), 0.01f, 1000.0f);

In godot 4 same models are working fine. With Same camera settings etc.

To solve this I keep it simple.

Update this value in model editor:
Cull Hint: Never

Set this value for the Armature or the Geometry.

2 Likes

let me Try this.

Thanks. Local Cull Hint— it Worked !!

1 Like

The other solutions you were suggesting were complex. Even if you fixed it as you suggested then you have to maintain that fix over time.

So keep it simple. And don’t code if you don’t have to.

1 Like

Added this to my comment:
“Set this value for the Armature or the Geometry.”

1 Like

let me know what are those solutions. Just want to know maybe I will use in future !

However, the real problem with your model is that somehow the bounding boxes are all wrong. When you move to certain angles, JME thinks your model is outside of the view and so culls it. That’s why setting the cull hint fixes the symptom.

…but the real issue is the bounding boxes. Normally these are calculated automatically so I’m not sure what steps were taken to make them wrong.

Edit: you can fix them at load time by creating a scene visitor that goes through every geometry, calls geometry.getMesh().updateBound(), then geometry.updateBound(). Run that visitor on the loaded model.

4 Likes

This happens a lot when apply changed size with armature in blender

1 Like