ModelViewer Example

Apr 3, 2012 at 10:26 PM
Edited Apr 4, 2012 at 9:10 PM

Hi Objo,

fine work all the Helix stuff! Keep it up, please!

I've noticed differences in displaying .obj files, exported from 3dsmax, between the downloadable compiled example of ModelViewer(Nov2011) and the example in the current source dowload package.

The already compiled version displays the .obj file pretty well, including transparency.
The non-compiled recommended source version fails to display some objects correctly.

There's a bunch of code commented out. When I remove the comments some of the code is buggy (list1, fileModelVisual3D.Children)

Could you please give a feedback on it?

Thanks and regards, xion.

Coordinator
Apr 4, 2012 at 11:32 PM

hi xion, can you provide some simple .obj test files that renders incorrectly? We have tried to solve some texture/transparency bugs since the november version, but there is probably some work left... Also, some features of the .obj format (smoothing groups?) are not yet supported.

Apr 6, 2012 at 3:29 PM

Yes I can provide the .obj file. Send you a p.m. with a downloadlink.

Coordinator
Apr 7, 2012 at 9:13 PM

Thanks, I think I found the bug - the "Tr" setting in the material file should set the material opacity to 1-Tr.

Apr 7, 2012 at 10:35 PM
Edited Apr 7, 2012 at 10:35 PM

Thats interesting! Is it a buggy .mtl file? I used the latest 3dsmax design to export the file.

Expression Blend (MS) has the same problems on import these obj/mtl files.

Coordinator
Apr 7, 2012 at 10:39 PM

sorry, I thought the error was in the helix interpreter, but then I checked the spec:

d alpha
defines the transparency of the material to be alpha. The default is 1.0 (not transparent at all) Some formats use Tr instead of d;
Tr alpha
defines the transparency of the material to be alpha. The default is 1.0 (not transparent at all). Some formats use d instead of Tr;
Your file has d=1 and Tr=0 for the same material - which should be an error.
I can add a "SkipTransparencyValues" property on the importer if this is a common error for files exported from 3dsmax.
Coordinator
Apr 7, 2012 at 11:08 PM

I have added a "SkipTransparencyValues" property to the "ObjReader". I also added support for smoothing groups.

Apr 8, 2012 at 9:44 AM

Thank you! 2012.2.2.1.46 shows all materials correctly. Thats great!

In 3dsmax the transparency value is called Opacity, which is set to 100% if the material is non-transparent. Maybe here's the clue.

Coordinator
Apr 8, 2012 at 11:05 AM

Good! 

Opacity 100% should be exported as d = 1.0 or Tr = 1.0 if the wikipedia spec is correct. I think the exporter you are using will export d=1.0 and Tr=0.0.

See http://en.wikipedia.org/wiki/Material_Template_Library