Skip to content

Instantly share code, notes, and snippets.

@StillManic
Last active January 8, 2016 20:31
Show Gist options
  • Save StillManic/aa6eeefe4c2354a7cf46 to your computer and use it in GitHub Desktop.
Save StillManic/aa6eeefe4c2354a7cf46 to your computer and use it in GitHub Desktop.
newmtl red
Kd 1 0 0
newmtl orange
Kd 1 0.5 0
newmtl yellow
Kd 1 1 0
newmtl yellow-green
Kd 0.5 1 0
newmtl green
Kd 0 1 0
newmtl green-blue
Kd 0 1 1
newmtl blue
Kd 0 0 1
newmtl purple
Kd 1 0 1
# This is an example of the vertex coloring feature for OBJ models. To specify vertex colors, a 'usemtl' command must be specified before each
# vertex as shown, as well as the 'mtllib' file must not have a 'map_Ka', 'map_Kd', or 'map_Ks' command, which automatically applies a White
# texture to the model.
# This file uses centimeters as units for non-parametric coordinates.
mtllib models/block/vertex_coloring.mtl
usemtl red
v 0.000000 0.000000 1.000000
usemtl orange
v 1.000000 0.000000 1.000000
usemtl yellow
v 0.000000 1.000000 1.000000
usemtl yellow-green
v 1.000000 1.000000 1.000000
usemtl green
v 0.000000 1.000000 0.000000
usemtl green-blue
v 1.000000 1.000000 0.000000
usemtl blue
v 0.000000 0.000000 0.000000
usemtl purple
v 1.000000 0.000000 0.000000
vt 0.375000 0.000000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.625000 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.375000 1.000000
vt 0.625000 1.000000
vt 0.875000 0.000000
vt 0.875000 0.250000
vt 0.125000 0.000000
vt 0.125000 0.250000
f 1/1 2/2 4/4 3/3
f 3/3 4/4 6/6 5/5
f 5/5 6/6 8/8 7/7
f 7/7 8/8 2/10 1/9
f 2/2 8/11 6/12 4/4
f 7/13 1/1 3/3 5/14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment