Fixed problems, textured cube
This commit is contained in:
parent
6c1e288b78
commit
c81dbc8715
|
@ -1,21 +0,0 @@
|
||||||
v 0.5 -0.5 -0.5
|
|
||||||
v 0.5 0.5 -0.5
|
|
||||||
v -0.5 0.5 -0.5
|
|
||||||
v -0.5 -0.5 -0.5
|
|
||||||
v 0.5 -0.5 0.5
|
|
||||||
v 0.5 0.5 0.5
|
|
||||||
v -0.5 0.5 0.5
|
|
||||||
v -0.5 -0.5 0.5
|
|
||||||
|
|
||||||
f 1 2 5
|
|
||||||
f 2 6 5
|
|
||||||
f 2 3 6
|
|
||||||
f 3 7 6
|
|
||||||
f 2 1 4
|
|
||||||
f 2 4 3
|
|
||||||
f 5 6 8
|
|
||||||
f 6 7 8
|
|
||||||
f 3 4 8
|
|
||||||
f 3 8 7
|
|
||||||
f 4 1 5
|
|
||||||
f 4 5 8
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
newmtl cubemtl
|
||||||
|
Ns 10
|
||||||
|
Ni 1.0
|
||||||
|
d 1.0
|
||||||
|
Tf 1 1 1
|
||||||
|
illum 2
|
||||||
|
Ka 0.5 0.5 0.
|
||||||
|
Kd 0.9 0.9 0.9
|
||||||
|
Ks 0.0 0.0 0.0
|
||||||
|
map_Kd cube.png
|
|
@ -0,0 +1,31 @@
|
||||||
|
mtllib cube.mtl
|
||||||
|
|
||||||
|
usemtl cubemtl
|
||||||
|
|
||||||
|
v -0.5 -0.5 -0.5
|
||||||
|
v -0.5 -0.5 0.5
|
||||||
|
v -0.5 0.5 -0.5
|
||||||
|
v -0.5 0.5 0.5
|
||||||
|
v 0.5 -0.5 -0.5
|
||||||
|
v 0.5 -0.5 0.5
|
||||||
|
v 0.5 0.5 -0.5
|
||||||
|
v 0.5 0.5 0.5
|
||||||
|
|
||||||
|
vt 0.0 0.0
|
||||||
|
vt 0.0 1.0
|
||||||
|
vt 1.0 0.0
|
||||||
|
vt 1.0 1.0
|
||||||
|
|
||||||
|
vn 1.0 0.0 0.0
|
||||||
|
vn 0.0 1.0 0.0
|
||||||
|
vn 0.0 0.0 1.0
|
||||||
|
vn -1.0 0.0 0.0
|
||||||
|
vn 0.0 -1.0 0.0
|
||||||
|
vn 0.0 0.0 -1.0
|
||||||
|
|
||||||
|
f 1/1/4 2/3/4 4/4/4 3/2/4
|
||||||
|
f 2/1/3 6/3/3 8/4/3 4/2/3
|
||||||
|
f 6/1/1 5/3/1 7/4/1 8/2/1
|
||||||
|
f 5/1/6 1/3/6 3/4/6 7/2/6
|
||||||
|
f 4/1/2 8/3/2 7/4/2 3/2/2
|
||||||
|
f 2/1/5 1/3/5 5/4/5 6/2/5
|
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
|
@ -23,7 +23,7 @@ class Material:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ix, iy, image = self.map_Kd.size[0], self.map_Kd.size[1], self.map_Kd.tobytes("raw", "RGBA", 0, -1)
|
ix, iy, image = self.map_Kd.size[0], self.map_Kd.size[1], self.map_Kd.tobytes("raw", "RGBA", 0, -1)
|
||||||
except SystemError:
|
except:
|
||||||
ix, iy, image = self.map_Kd.size[0], self.map_Kd.size[1], self.map_Kd.tobytes("raw", "RGBX", 0, -1)
|
ix, iy, image = self.map_Kd.size[0], self.map_Kd.size[1], self.map_Kd.tobytes("raw", "RGBX", 0, -1)
|
||||||
|
|
||||||
self.id = gl.glGenTextures(1)
|
self.id = gl.glGenTextures(1)
|
||||||
|
|
|
@ -53,7 +53,7 @@ class OBJParser(ModelParser):
|
||||||
face.material = self.current_material
|
face.material = self.current_material
|
||||||
self.add_face(face)
|
self.add_face(face)
|
||||||
elif len(split) == 4:
|
elif len(split) == 4:
|
||||||
face = Face().form_array(splits[:3])
|
face = Face().from_array(splits[:3])
|
||||||
face.material = self.current_material
|
face.material = self.current_material
|
||||||
self.add_face(face)
|
self.add_face(face)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue