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

Method __init__

pyrender.py:766–797  ·  view source on GitHub ↗
(self, 
                 x=0, y=0, z=0, 
                 yaw=90, pitch=0, roll=0,
                 width=None, height=None,
                 z_near=0.05, z_far=255,
                 fov=90,
                 fxaa=False,
                 obj_buffer = True,
                 mode=0,
                 light=None)

Source from the content-addressed store, hash-verified

764 )
765
766 def __init__(self,
767 x=0, y=0, z=0,
768 yaw=90, pitch=0, roll=0,
769 width=None, height=None,
770 z_near=0.05, z_far=255,
771 fov=90,
772 fxaa=False,
773 obj_buffer = True,
774 mode=0,
775 light=None) -> None:
776 self.x = float(x)
777 self.y = float(y)
778 self.z = float(z)
779 self.yaw = float(yaw)
780 self.pitch = float(pitch)
781 self.roll = float(roll)
782 self.width, self.height = self.get_width_and_height(width, height)
783 self.z_near = float(z_near)
784 self.z_far = float(z_far)
785 self.fov = fov
786 self.fxaa = fxaa
787 if mode >= 6 and obj_buffer:
788 print("\033[31;1m" +
789 "Warning! Camera mode 6 and 7 do not support obj_buffer. " +
790 "Obj_buffer is set to false")
791 self.obj_buffer = False
792 else:
793 self.obj_buffer = obj_buffer
794 self.mode = mode
795 self.light = light
796 self.rotation = self.get_rotation_mat()
797 self.rendering_plane_z = self.width * 0.5 / tan(fov * pi / 360)
798
799
800 def __str__(self):

Callers

nothing calls this directly

Calls 2

get_width_and_heightMethod · 0.95
get_rotation_matMethod · 0.95

Tested by

no test coverage detected