3D models not properly rendered inside GUI viewport

Hello guys

I was trying to implement a simple gui displaying 3D rotating model at the center of the screen.

I could do it without problem, but I saw a graphical depth trouble during the rotation, for example for this man I see his eyes throught his head, and shirt rendered behind his body… stuff like these…

Code is following

Spatial revolverSpat = (Spatial) assetManager.loadModel(“Models/TP/TP.mesh.j3o”);
testNode = new Node(“test”);
new SceneGraphVisitor() {
public void visit(Spatial s) {
guiViewPort.setClearFlags(true, true, true);


Do you know how to solve this problem?

Thank you!

The gui node uses a parallel projection, which doesn’t have the concept of depth. Use another viewport for this instead

1 Like

Thank you very much, I will try it

1 Like