JSModeler
JSModeler copied to clipboard
Lego Brick OBJ example
The attached is just a somewhat interesting OBJ example that was created by JSModeler and modified by me to include outside and inside meshes / materials.
Feel free to use it anywhere and close this non-issue at any time.
The following pictures show what it looks like with edges applied in my OBJ viewer, while the Online 3D Viewer did show slightly different inside color.


Ah, I remember the good old times when I was writing the lego brick generator for JSModeler. :)
About the color: which one do you think is closer to the correct one?
It appears that the correct inside color is the one in my picture.
If I remove the "Ke" entry from the inside material (MTL file) then I get the same color as in your Online 3D Viewer.
This "Ke" entry is described as "Emission Color effect on material appearance" according to this link:
https://forums.ni.com/t5/3D-Vision/OBJ-File-Format-for-3D-Robot-Simulations/td-p/3535101?profile.language=en
In this case it seems like a bug, so it's better to keep this issue open. Thanks for reporting.
This is just for your knowledge.
All my viewers are designed to let Three.js do all the processing of any entries. For as long as it is a valid entry, which Three.js programmers have taken into account when designing their libraries, then it will be processed.
Just by having an instance of each MTLLoader and OBJLoader, the whole process of loading these lego brick MTL and OBJ files could be summarized in 2 lines of code:
mtl_loader.load( mtl_file, function( mtl ) { mtl.preload(); obj_loader.setMaterials( mtl ); } ); obj_loader.load( obj_file, function ( object ) {} );
This would be true since the lego brick MTL file doesn't require any JPG/PNG/BMP/DDS texture files.