Extent of OBJ importer (how finished is it) ?

Feb 20, 2014 at 2:52 PM
Edited Feb 20, 2014 at 3:43 PM
Hi Objo !

I'm still playing with the OBJ importer.

Could you please tell me what parts of the material file are working at the momemt ?

For example, what parts of this example actually get used :

newmtl 3_SkinForearm
d 1
Ns 1
Ni 0
Ka 0.858824 0.92549 0.937255
Kd 0.901961 1 0.996078
Ks 0.866667 0.929412 0.945098
Km 0.00252632
map_Kd Maps/RMDelphL.jpg
map_Bump Maps/RMDelphLBp.jpg

So is the bump map used, is Ns and Ni used and so on ?

I don't know what all these do, but I do get some strange results some times and I have to remove things from the material file.

It would be good to remove things that are not implemented yet, I just need to know what they are.

Many thanks :)
Feb 20, 2014 at 7:36 PM
The materials in the 3D model of WPF are quite limited, bump maps are not supported and I have not found a way to include the ambient components easily.
You can see the implementation in the MaterialDefinition.CreateMaterial method in the ObjReader
I agree it would be a good idea to create an overview of what is supported and not.
Note that the importers are also included in the refactoring task

Also consider Assimp.NET for a proven .obj importer. Has anyone found a good WPF adapter for it?
Feb 20, 2014 at 8:19 PM
Edited Feb 21, 2014 at 5:15 PM
I did look at Assimp.NET but there is no documentation for C#. Since I am still learning C# I can't get into that directly. Maybe in time..

From the ObjReader.cs to me it looks it does parse all the settings but in the end it supports Diffuse, Ambient and Specular and also the texture map.

So really, if you could confirm... this is the current state :

newmtl 3_SkinForearm
d 1 <- used (translated to Opacity)
Ns 1 <- used
Ni 0 <- ignored
Ka 0.858824 0.92549 0.937255 <- ignored
Kd 0.901961 1 0.996078 <- used
Ks 0.866667 0.929412 0.945098 <-used
Km 0.00252632 <- ignored
map_Kd Maps/RMDelphL.jpg <- used
map_Bump Maps/RMDelphLBp.jpg <- ignored
map_D <- ignored

Is that correct ?

Cheers :)
Feb 20, 2014 at 9:40 PM
the following should be corrected
d <- used (translated to Opacity)
Ns <- used
Ka <- ignored
Km <- ignored

full spec at http://paulbourke.net/dataformats/mtl/
Feb 20, 2014 at 10:35 PM
OK that's been corrected, I thought I probably did not get that right.

Thanks for the link to the specification.
Feb 20, 2014 at 10:36 PM
It goes to show how much work you have done :)
Feb 21, 2014 at 2:52 PM
Regarding the bump map - I have found comments that this might be possible with a Pixel Shader. But I have not found any example code as yet.
Feb 21, 2014 at 5:16 PM
Edited Feb 21, 2014 at 7:43 PM
I added that map_D is also ignored for now.

What about map_Ks ?
Feb 27, 2014 at 6:33 PM
Edited Feb 28, 2014 at 5:05 PM
I'm a bit confused about Ns too. Wikipedia has this page : http://en.wikipedia.org/wiki/Wavefront_.obj_file#Basic_materials

It says :
Ns 10.000 # ranges between 0 and 1000
My models from Daz have things like : Ns 0.5

Also I tried changing Ns of some of my model parts for example :

Ns 1000

And when viewed in the Helix model viewer there is no difference.

Also this page : http://people.sc.fsu.edu/~jburkardt/data/mtl/mtl.html
Ns s
defines the shininess of the material to be s. The default is 0.0;
So one would have thought that changing Ns to 1000 would make it shiny, but it doesn't.

So I am left wondering...
Feb 28, 2014 at 4:53 PM
Edited Feb 28, 2014 at 5:48 PM
Rogad wrote:
What about map_Ks ?