Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lego Brick OBJ example #51

Open
GitHubDragonFly opened this issue Aug 24, 2021 · 4 comments
Open

Lego Brick OBJ example #51

GitHubDragonFly opened this issue Aug 24, 2021 · 4 comments
Labels

Comments

@GitHubDragonFly
Copy link

GitHubDragonFly commented Aug 24, 2021

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.

legobrick.zip

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.

Lego Brick 1

Lego Brick 2

@kovacsv
Copy link
Owner

kovacsv commented Aug 24, 2021

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?

@GitHubDragonFly
Copy link
Author

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

@kovacsv
Copy link
Owner

kovacsv commented Aug 24, 2021

In this case it seems like a bug, so it's better to keep this issue open. Thanks for reporting.

@kovacsv kovacsv added the bug label Aug 24, 2021
@GitHubDragonFly
Copy link
Author

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.

GitHubDragonFly added a commit to GitHubDragonFly/HTML_CSS_JS that referenced this issue Aug 31, 2021
Created by [JSModeler](https://github.com/kovacsv/JSModeler) and modified by me to include outside and inside meshes / materials.

You can see its pictures [here](kovacsv/JSModeler#51).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants