Skip to content

Commit 1252170

Browse files
committed
Fix code errors for interactive 3D renderer
1 parent 012d5a9 commit 1252170

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

graphics/interactive_3d_renderer.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import tkinter as tk
1313
import math
14-
from typing import List, Tuple
1514

1615

1716
class Vector3D:
@@ -126,9 +125,9 @@ class Mesh:
126125
"""
127126

128127
def __init__(self):
129-
self.vertices: List[Vector3D] = []
130-
self.triangles: List[Tuple[int, int, int]] = []
131-
self.normals: List[Vector3D] = []
128+
self.vertices: list[Vector3D] = []
129+
self.triangles: list[tuple[int, int, int]] = []
130+
self.normals: list[Vector3D] = []
132131
self.position: Vector3D = Vector3D(0, 0, 0)
133132
self.rotation: Vector3D = Vector3D(0, 0, 0)
134133

@@ -216,7 +215,7 @@ class Camera:
216215
Vector3D(1, 2, 13)
217216
"""
218217

219-
def __init__(self, position: Vector3D = Vector3D(0, 0, 0), fov: float = 90):
218+
def __init__(self, position: Vector3D, fov: float = 90):
220219
self.position = position
221220
self.fov = fov
222221
self.yaw = 0.0
@@ -302,7 +301,7 @@ def __init__(self, width=400, height=300, title="Tkinter Graphics Window"):
302301
self.canvas.pack(fill=tk.BOTH, expand=True)
303302
self.running = True
304303
self.root.protocol("WM_DELETE_WINDOW", self.close)
305-
self.meshes: List[Mesh] = []
304+
self.meshes: list[Mesh] = []
306305
self.root.minsize(width, height)
307306
self.root.bind("<Configure>", self.on_resize)
308307
self.root.bind("<KeyPress>", self.on_key)

0 commit comments

Comments
 (0)