Added a very simple light source so the 3D models now have simple shading applied to them.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from vectors import Vector2d, Vector3d, Vector4d
|
||||
from matrix import Matrix3x3
|
||||
from triangle import Triangle
|
||||
|
||||
class Engine:
|
||||
def __init__(self, width, height):
|
||||
@@ -40,7 +41,5 @@ class Mesh:
|
||||
row0 = self.vertices[int(tmp[1]) - 1]
|
||||
row1 = self.vertices[int(tmp[2]) - 1]
|
||||
row2 = self.vertices[int(tmp[3]) - 1]
|
||||
|
||||
tri = Matrix3x3(row0, row1, row2)
|
||||
|
||||
self.triangles.append(tri)#Vector3d(x - 1, y - 1, z - 1))
|
||||
self.triangles.append(Triangle(Matrix3x3(row0, row1, row2)))
|
||||
|
||||
Reference in New Issue
Block a user