MCPcopy Create free account
hub / github.com/ICE27182/Python-3D-renderer / Scene

Class Scene

pyrender.py:934–967  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

932
933
934class Scene(Object, Light, Camera):
935 def __init__(self) -> None:
936 self.objects = []
937 self.v = []
938 self.vt = []
939 self.vn = []
940 self.materials = {}
941 self.default_obj_dir = Object.default_obj_dir
942 self.default_uv_map_properties = Object.default_uv_map_properties
943 self.lights = []
944 self.cam = Camera()
945
946
947 def render(self):
948 pass
949
950
951 def display(frame) -> None:
952 frame_in_str = []
953 for row in frame:
954 for pixel in row:
955 if pixel == (0, 0, 0):
956 frame_in_str.append(" ")
957 else:
958 frame_in_str.append(
959 f"\033[38;2{pixel[0]};{pixel[1]};{pixel[2]}m██"
960 )
961 frame_in_str.append("\n")
962 print("".join(frame_in_str), end="\033[0m")
963
964
965 def mainloop(self):
966 while True:
967 pass
968
969
970

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected