Ant (Anthony) (necro_ignis) wrote in 3dgraphics,
Ant (Anthony)
necro_ignis
3dgraphics

Hi all, I've been looking around on the net for about three days to a solution to a problem I am having with .obj and .mtl files. A bit new to 3D programming, I am loading a very basic scene I created in FluxStudio 2.0 into Java3D via an .obj and .mtl file through an ObjectFile object.


I create three very simple objects, a cone, sphere and cylinder. I give each an individual texture, then export the scene as a wavefront .obj. It produces the following .mtl file:

# File produced by

newmtl dad_Box1
Ns 4
d 1
illum 2
Kd 1.000000 0.000000 0.000000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000

newmtl dad_Cone1
Ns 4
d 1
illum 2
Kd 1.000000 0.000000 0.000000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000

newmtl dad_Sphere1
Ns 4
d 1
illum 2
Kd 1.000000 0.000000 0.000000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
map_Kd D:\Profiles\aan025\My Documents\141_1920.jpg

The problem is when I load the .obj file into Java3D there is now only one texture shared across the three objects. So It looks totally different between FluxStudio and Java3D. I did some reading into .mtl and .obj files, and started pulling them apart. The above example is the .mtl file for three objects created by FluxStudio. Notice how there is only one map_Kd link shared between the three. If I either move this one line to either of the one of the two materials then everything vanishes, if I put in a brand new line in the other two materials pointing at different images then they still remain wrapped in the same texture of the third material.

Help! :-) What's going on. Why is FluxStudio displaying 3 different textures, but when you export the image into a wavefront format something obviously changes. I don't know much about 3D Programming and Modeling and I'm trying my best (I must say it's a damn enjoyable learning curve)
  • Post a new comment

    Error

    default userpic
  • 0 comments