TangentBinormalGenerator Removing Triangles

I am using:

[java] TangentBinormalGenerator.generate(wall4); [/java]



However, it is removing some triangles from my model. When I remove it, the triangles return.



[java]

Spatial wall4 = assetManager.loadModel(“Models/HighWall2/HighWall2.j3o”);

wall4.setMaterial(material2);

wall4.setLocalTranslation(10, 0, 10);

TangentBinormalGenerator.generate(wall4);

z.attachChild(wall4);

[/java]



I don’t think it’s about the material, because there are other models which display well with it and with TangentBinormalGenerator.generate. Any help?



1 Like

I think it doesn’t remove them but they are probably inside-out, meaning their normals point in the wrong direction. Post a screenshot.

There’s a link at the end.



But here it is: http://i40.tinypic.com/34tei9s.png



Here, it’s two triangles. However, sometimes it also ‘hides’ one.

Any help? The only way how I could make the triangles show was to enable VertexLighting, but that removes the Parallax’s effect.

For a test set the faceculling off, maybee some of those triangles are clockwise instead of counterclockwise

Nope. Same result :confused:

something must be wrong with the normals then

Could you upload the j3o file?

This is also happening when I rotate them by 180 DEG:



http://i42.tinypic.com/wujae0.jpg



Could it be because I am using a plane imported from 3DS Max?

What does TangentBinormalGenerator.generate(); do anyway?



I removed it from the walls, and the result was the same as far as I could tell. Moreover, this didn’t happen:



http://i42.tinypic.com/wujae0.jpg



And this neither:



http://i40.tinypic.com/34tei9s.png



This is the result I got:



http://i41.tinypic.com/21ops88.jpg



Any difference?



EDIT: Could it be that 3DS Max automatically creates the normals and there was some ‘interference’? I made a new model and checked an option to create Tangents and BiNormals from OGRE Max. However, the results were the same.

Do you use the plane directly or use it as a polygonal shape (or similar), as far as I know the exporter is only supposed to work with polygonal shapes,(as thats what all games use) but Im not that sure, you better look at the documantation of ogremax

I just export it from 3DS Max, and load using assetManager.loadModel.



I just don’t know what TangentBinormalGenerator.generate(); does, because the result is the same.

if you export with tangents, nothing. (if not it generates them but you already do that in the exporter.

(also result should be identical if course, no matter if done with exporter, or with jme)

SO its not the tangent binominals causing this behaviour. I guess the model is corrupted.

I re-created the model and imported it. Same result.



I added an ambient light, and where the triangles are hidden, there’s a dark grey colour.



Btw, what did you mean by “if you export with tangents, nothing.”?

I generated Tangents from the SceneComposer. Same problem. Should everything work well if I don’t use TangentBinormalGenerator.generate();?

Strange one. I’ve continued testing. The problem only comes up whenever I rotate the model. Any help?

Problem solved. Instead of rotating the models, I just created rotated models and imported them. Thanks to all who tried to help.

how do you rotate your model?

[java]wall.rotate();

[/java]

It only occurred to me after I found the problem that I could have just created four nodes (for the four different rotated models) and just rotated them -.-

Well…rotating a model should not screw up the Normals…something is weird here