0

Cracks in Texture of OBJ

Anonymous 5 years ago 0
This discussion was imported from CodePlex

cmouritsen wrote at 2014-01-31 00:49:

I am importing an OBJ model with a texture that references an image. The edges of the different pieces in the image show up as cracks in the viewer. Is this something I can fix in the helixtoolkit code or is it a problem in the .NET code? (The model looks fine in MeshLab)

Image

objo wrote at 2014-02-02 12:11:

It's a nice effect! :-) But I guess you don't want it to look like that..
What does the textures look like? Examine the edges in a image editor.
Could it be a problem with the ImageBrush? Are texture coordinates clamped in [0,1]?

cmouritsen wrote at 2014-02-19 15:40:

The texture coordinates are clamped in [0,1]. As I mentioned the model and texture display fine in MeshLab. Can you point me to the code that causes a triangle to get rendered to the viewport? Is that even in the HelixToolkit code?

Thanks.

objo wrote at 2014-02-19 20:56:

The importer creates a MeshGeometry3D with positions and texture coordinates. The material is created from an ImageBrush.
I guess the problem is with the material since this is only a problem on the edges. Can you post the texture image?
You could also try changing the TileMode of the ImageBrush (my wild guess).

cmouritsen wrote at 2014-02-20 17:54:

I have to get permission to share the texture file. While I'm waiting for that, I've shared an obj/mtl pair in another thread that also doesn't display correctly in the Helix viewer. I'm not sure that it's the exact same issue, but it is evidence that the viewer has problems with image textures.

Also, my colleague who knows more about 3D than I do thinks that the trouble crops up only where the UV map has a discontinuity, i.e., you have triangles that are adjacent in the mesh, but map to portions of the texture image that aren't adjacent to each other.

Finally, I have tried all of the different TileModes (I assume you mean in the CreateTextureBrush method?) and it didn't make any difference.

Thanks for your help.

objo wrote at 2014-02-20 20:53:

Ok, the link in the other thread should be a good start. I have added issue https://helixtoolkit.codeplex.com/workitem/10029

cmouritsen wrote at 2014-02-20 20:57:

Great. Thanks.


Rogad wrote at 2014-02-27 21:06:

I don't mean to hijack this thread, but just wanted to say I am getting a similar problem with what are the seems I guess.

Loads fine in MeshLab, but not in Helix...


Image

objo wrote at 2014-02-27 23:04:

Thanks for all the input regarding the OBJ importer, rogad.
I will look into the OBJ importer when refactoring it to the new PCL library (#10023). This should include a test suite of OBJ models, also including models with ´texture cracks´.

Rogad wrote at 2014-02-27 23:20:

No problem :)

I've been doing a fair bit of work with my models so I am starting to understand better how OBJ files work. So I just drop my observations in here when I think they are useful.

badgerbadger wrote at 2014-05-28 17:08:

Hello, I am experiencing similar issues with the rendering of obj textures and was wondering if any one has code fix or modifications that they are willing to share?