|
11 | 11 |
|
12 | 12 | import tkinter as tk |
13 | 13 | import math |
14 | | -from typing import List, Tuple |
15 | 14 |
|
16 | 15 |
|
17 | 16 | class Vector3D: |
@@ -126,9 +125,9 @@ class Mesh: |
126 | 125 | """ |
127 | 126 |
|
128 | 127 | 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] = [] |
132 | 131 | self.position: Vector3D = Vector3D(0, 0, 0) |
133 | 132 | self.rotation: Vector3D = Vector3D(0, 0, 0) |
134 | 133 |
|
@@ -216,7 +215,7 @@ class Camera: |
216 | 215 | Vector3D(1, 2, 13) |
217 | 216 | """ |
218 | 217 |
|
219 | | - def __init__(self, position: Vector3D = Vector3D(0, 0, 0), fov: float = 90): |
| 218 | + def __init__(self, position: Vector3D, fov: float = 90): |
220 | 219 | self.position = position |
221 | 220 | self.fov = fov |
222 | 221 | self.yaw = 0.0 |
@@ -302,7 +301,7 @@ def __init__(self, width=400, height=300, title="Tkinter Graphics Window"): |
302 | 301 | self.canvas.pack(fill=tk.BOTH, expand=True) |
303 | 302 | self.running = True |
304 | 303 | self.root.protocol("WM_DELETE_WINDOW", self.close) |
305 | | - self.meshes: List[Mesh] = [] |
| 304 | + self.meshes: list[Mesh] = [] |
306 | 305 | self.root.minsize(width, height) |
307 | 306 | self.root.bind("<Configure>", self.on_resize) |
308 | 307 | self.root.bind("<KeyPress>", self.on_key) |
|
0 commit comments