|
Sweet Home 3D Forum » List all forums » » Forum: Developers » » » Thread: Missing texture coordinates in MTL file lead to blurry textures? |
|
| Print at Dec 19, 2025, 6:22:57 PM | View all posts in this thread on one page |
| Posted by npi at Jun 12, 2013, 9:08:56 AM |
Missing texture coordinates in MTL file lead to blurry textures?Hi all, I am currently developing an application which renders 3D models exported from Sweet Home 3D using Java3D. The models are exported as obj / mtl file. The model itself looks OK within my own application. However, as described in this thread thread in the Java3D forum, most textures are rendered blurry allthough the exported image files look OK. A commentor in my Java 3D forum thread mentioned the idea, that the blurryness may come from missing texture coordinates within the exported MTL file. This idea makes sense to me especially since I can improvove the texture rendering result by making some manual transformations (allthough I was not able to reach a result even similar to what SH3D can do). Therefore, my question is: Is there any possibility to export texture coordinates from SH3D or does anyone have another solution to the mentioned problem? Sincerely, Thomas |
| Posted by Puybaret at Jun 12, 2013, 9:56:44 AM |
|
Re: Missing texture coordinates in MTL file lead to blurry textures? Is your OBJ/MTL model correctly rendered when you reimport it in Sweet Home 3D or in another 3D software like Blender? Did you try to load it with com.eteks.sweethome3d.j3d.OBJLoader class, the OBJ loader I developed for Sweet Home 3D? Actually, I developed it because Java 3D com.sun.j3d.loaders.objectfile.ObjectFile class had some issues in texture coordinates and transparency management. Even I also needed a few other things for Sweet Home 3D, I managed to keep OBJLoader class independent from other Sweet Home 3D classes, except the small OBJMaterial class. ---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
| Posted by npi at Jun 12, 2013, 11:18:03 AM |
|
Re: Missing texture coordinates in MTL file lead to blurry textures? Hi Emmanuel, first, thanks for the quick reply! Regarding your questions and hints: Is your OBJ/MTL model correctly rendered when you reimport it in Sweet Home 3D or in another 3D software like Blender? I was not able to find a menu option to import an obj-file into SH3D. Do I miss something or do you refer to programmatically loading a file using the libraries of SH3d? I also tried Blender but my notebook has not enough performance to load my current model in the program - actually, I wanted to create a simpler model to try the import but didn't do it yet. id you try to load it with com.eteks.sweethome3d.j3d.OBJLoader class, the OBJ loader I developed for Sweet Home 3D? No, I was not aware of this class but just tried it. The model loads and I assume it may look better regarding the textures. However, the viewpoint is zoomed to maximum into an object and I am not able to zoom out enough to see the whole model. The problem may be, that I use the RESIZE flag and the radiens param of the class com.sun.j3d.loaders.objectfile.ObjectFile when loading the obj using pure Java3D. I could not find those params in your class. Could you provide a hint how to change the viewport or resize the model? Thanks in advance, seem to be close to a solution! |
| Posted by Puybaret at Jun 12, 2013, 11:27:47 AM |
|
Re: Missing texture coordinates in MTL file lead to blurry textures? I was not able to find a menu option to import an obj-file into SH3D. Drag and drop the OBJ file onto the plan, or use the furniture import wizard displayed by Furniture > Import Furniture menu item.However, the viewpoint is zoomed to maximum into an object and I am not able to zoom out enough to see the whole model. The problem may be, that I use the RESIZE flag and the radiens param of the class com.sun.j3d.loaders.objectfile.ObjectFile when loading the obj using pure Java3D. I could not find those params in your class. Could you provide a hint how to change the viewport or resize the model? As the RESIZE flag isn't supported by OBJLoader class, just add a TransformGroup instance that will resize the loaded model. Have a look to ModelManager#getNormalizedTransform method if you look for a way to get the right transformation.---------------------------------------- Emmanuel Puybaret, Sweet Home 3D creator |
|
|
Current timezone is GMT Dec 19, 2025, 6:22:57 PM |