-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6710 from diyaayay/Mtl-support-to-obj-files
.mtl files support for .obj files to render color in 3D custom geometry
- Loading branch information
Showing
14 changed files
with
471 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Simple Cube OBJ File | ||
|
||
# Vertices | ||
v 0.0 0.0 0.0 | ||
v 1.0 0.0 0.0 | ||
v 1.0 1.0 0.0 | ||
v 0.0 1.0 0.0 | ||
v 0.0 0.0 1.0 | ||
v 1.0 0.0 1.0 | ||
v 1.0 1.0 1.0 | ||
v 0.0 1.0 1.0 | ||
|
||
# Faces | ||
f 1 2 3 4 | ||
f 5 6 7 8 | ||
f 1 5 8 4 | ||
f 2 6 7 3 | ||
f 4 3 7 8 | ||
f 1 2 6 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
newmtl coloredMaterial | ||
Ns 96.078431 | ||
Ka 1.000000 1.000000 1.000000 | ||
Kd 1.000000 0.000000 0.000000 # Only this material has a diffuse color | ||
Ks 0.500000 0.500000 0.500000 | ||
Ke 0.0 0.0 0.0 | ||
Ni 1.000000 | ||
d 1.000000 | ||
illum 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
mtllib eg1.mtl | ||
|
||
v 0 0 0 | ||
v 1 0 0 | ||
v 1 1 0 | ||
v 0 1 0 | ||
v 0.5 0.5 1 | ||
|
||
# Define faces without material | ||
f 1 2 5 | ||
f 2 3 5 | ||
|
||
# Apply material to subsequent faces | ||
usemtl coloredMaterial | ||
f 1 4 5 | ||
f 4 1 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
mtllib octa.mtl | ||
v 1 0 0 | ||
v 0 1 0 | ||
v 0 0 1 | ||
v -1 0 0 | ||
v 0 -1 0 | ||
v 0 0 -1 | ||
usemtl m000001 | ||
f 1 5 6 | ||
usemtl m003627 | ||
f 2 1 6 | ||
usemtl m010778 | ||
f 1 2 3 | ||
usemtl m012003 | ||
f 4 2 6 | ||
usemtl m019240 | ||
f 4 5 3 | ||
usemtl m021392 | ||
f 5 4 6 | ||
usemtl m022299 | ||
f 2 4 3 | ||
usemtl m032767 | ||
f 5 1 3 |
Oops, something went wrong.