Converting to j3o creates flickering issues

I don’t see any of the colored vectors there that display the normals, binormals, and tangents.

Run TestTangentGen, that is what the output should look like (with the arrows).

1 Like

Sorry if I am being slow but I am having a problem doing that.



TangentBinormatGenerator.generate() takes a mesh as a parameter. I am importing an object as a spatial. How can I get its Mesh. I tried casting it to Node (the object has two geometries) and trired to get the mesh using something like this:



[java] Geometry dede = (Geometry) de.getChild(1);

Geometry debug = new Geometry(

"Debug ",

TangentBinormalGenerator.genTbnLines(dede.getMesh(), 0.08f)

);



[/java]



but no vectors appearing…





edit:



and if I try

[java]

TangentBinormalGenerator.generate(dede.getMesh());

[/java]



I get:

[java]

Can only generate tangents for meshes with texture coordinates

[/java]

[java]

for (all children) {

if spatial.getChild(i) instanceof Geometry

((Geometry)spatial.getChild(i)).getMesh()

[/java]

make it recursive to keep finding children until you get to the geometry.



And please look at the API and study how Spatials and children work. All of the information is in the method comments of the API; and Spatial, Node, and Geometry are 3 classes that everyone should know like the back of their hand since they are used everywhere.

1 Like

but still I get the ssame error:



[java]Can only generate tangents for meshes with texture coordinates[/java]



why does my object does not have texture coordinates? I mean I can see it it with material and everything except that it flickers



I even tried it with a nother object (that has 3 geometries) and it wont detect any of them.



[java] Mesh submesh = null;



for (int i=0; i < 3; i++) {

if (((Node) mySpatial).getChild(i) instanceof Geometry)

{

submesh = ((Geometry)((Node) mySpatial).getChild(i)).getMesh();

}

}



Material mat = assetManager.loadMaterial("Common/Materials/VertexColor.j3m");



// generate tangents to avoid z fighting

TangentBinormalGenerator.generate(submesh);



Geometry debug = new Geometry(

"Debug ",

TangentBinormalGenerator.genTbnLines(submesh, 0.08f)

);



rootNode.attachChild(debug);

debug.setLocalTranslation(0,0,0);

debug.setCullHint(CullHint.Never);

debug.setMaterial(mat); [/java]

that method has to be recursive to find the proper child geometry. Confirm that the geometry you find is not null, walk through in the debugger and see exactly what you are getting

1 Like

There is a generate method that takes spatial as parameter …

[java]

public static void generate(Spatial scene)

[/java]

Also i don’t think it’s a tangent issues.

For me it’s z-fighting because your scale is way too small

and how would I fix that @nehon?



I have tried:


  • changing the background
  • switching from obj to xml
  • tried turning on VSynch
  • tried changing the DepthBits from 16 to 24bits (from settings)
  • tried changing the direction of the light vectors
  • tried different types of light (incl Ambien Light)

Haven’t really read this thread, but maybe you have vertices going where they shouldn’t or overlapping ones?



in blender, go to edit mode, click a, and in the search, type remove duplicate vertices or something and remove them all. No idea if that will help but worth a shot

already tried that, there’s nothing to duplicate

yu were right, it did flicker in Blender - I tried the fix… it stopped the flickering from Blender but still it flickers in jMonkey :frowning:

oO are you talking to yourself?

lol…this is hilarious… George you know that there is a name for that condition?



What’s too bad is that for once that you solve your own issue by yourself you’re just faking being someone else just to thumb you up…

I would have thumb you up 10 times if you have said “I fixed my issue all by myself!!!”



Stop playing that game please and keep only one account…



EDIT : I misread …and actually you didn’t fix your issue… i don’t know what to say…

@nightwolf911 said:
???? have you thought of two users one house? lol

Not really if they communicate via an internet forum but w/e ^^

You can buy the coveted jmonkey thong with those points.

…Well…i’m glad you fixed your issue…both of you…wait whose problem was it already?



@garnaout, what kind of mate picks almost the same mail address as you?..and most part of it being your name?.. that’s weird…looks like an obsession…

oh ok…well that’s fine the situation is now clear.