Model missing sides

I made a model using Blender 2.79, and have exported it into jme sdk in fbx and obj. When I run the program with the model (in fbx), it is stretched awkwardly and there are gaps in the model that were not there previously.

When running with obj or j3o, the model is fine, except there are some faces that will disappear when looking at the right angle.

The model looks fine in Blender, and I haven’t done anything unusual with the model (unless you count uv unwrapping or vertex extending unusual) or in the code. I opened the models in SceneComposer, and it’s the same as running the program.

Spatial kart = assetManager.loadModel("Models/Karts/StandardKart.fbx");
kart.setLocalTranslation(0, 0, 0);
Material kartMat = new Material(assetManager, "Common/MatDefs/Light/Lighting.j3md");
kartMat.setTexture("DiffuseMap", assetManager.loadTexture("Models/Karts/StandardKart.png"));

Edit: does it have anything to do with awkwardly bending faces?

1 Like

I fixed the stretching problem. The model was scaled in object mode, and it probably didn’t register with fbx. I scaled it in edit mode to fix it, but I’m still having troubles with sides disappearing.

1 Like

99% of the time, stuff like this can be because modifiers weren’t applied before exporting. And since your second post already confirms that you didn’t… that would be the first place to start.

It could. We can’t see them so it’s hard to say.

My model doesn’t have any modifiers, applied or pending.

I’ve divided some sides into triangles to avoid the bending, but it’s still happening.

kart in blender

Might it have something to do with texturing?

I loaded another model from Blender, and the same problem is happening. Faces keep disappearing when the camera is in the right position.

This is a picture of a racetrack model. It is missing a lot of sides.

Plus, I’m getting warnings.

WARNING: FBX model isn’t using correct forward axis sign. Orientation could be incorrect
Apr 24, 2021 10:38:17 AM com.jme3.scene.plugins.fbx.misc.FbxGlobalSettings fromElement
WARNING: FBX model isn’t using meters for world units. Scale could be incorrect.
Apr 24, 2021 10:38:17 AM com.jme3.scene.plugins.IrUtils triangulate
WARNING: N-gon encountered, ignoring. The mesh may not appear correctly. Triangulate your model prior to export.
Apr 24, 2021 10:38:17 AM com.jme3.scene.plugins.IrUtils triangulate

1 Like

On the apply thing, I meant transforms.

Anyway, what if you try a better supported format like gltf?

Blender displays faces using double-sided materials. JME materials default to single-sided. So I wonder if some of the model faces have flipped normals. A quick fix might be to make the applied materials double-sided in JME, using material.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off).

1 Like

Or in Blender edit mode do a Mesh → Normals → Recalculate Outside

1 Like

The fact that it’s dynamic based on camera position makes me think of culling.

Culling makes me think of odd transforms that make the bounding shape fall outside of the camera view even when the should be in view.

Odd transforms makes me think of “applying transforms”… which from the first post we already know wasn’t done because of the bit about “object mode scaling”.

…but sometimes formats are weird, too. And the only time I’ve had a problem like this with gltf was related to weird animation. (see thread about chicken) And I generally distrust the less supported formats like fbx. OBJ should have been ok, though, if transforms were applied.

I triangulated my model, and it fixed the problem with the second model. Triangulation didn’t work for the first model.

1 Like