예제 #1
0
	def load(self) -> None:
		if self.file_obj is None:
			return
		if self.tracer is None:
			return

		for face in self.file_obj.face_list:
			# get vertex
			vertex_0:	Tuple[float, float, float]	= self.file_obj.geometric_vertex_list[face[0] - 1]
			vertex_1:	Tuple[float, float, float]	= self.file_obj.geometric_vertex_list[face[1] - 1]
			vertex_2:	Tuple[float, float, float]	= self.file_obj.geometric_vertex_list[face[2] - 1]

			# create hitable
			hitable: Hitable_Trimesh = self.tracer.Hitable_Trimesh()
			hitable.setPoint_0(
				Vec3f(vertex_0[0] * self.scale[0], vertex_0[1] * self.scale[1], vertex_0[2] * self.scale[2]))
			hitable.setPoint_1(
				Vec3f(vertex_1[0] * self.scale[0], vertex_1[1] * self.scale[1], vertex_1[2] * self.scale[2]))
			hitable.setPoint_2(
				Vec3f(vertex_2[0] * self.scale[0], vertex_2[1] * self.scale[1], vertex_2[2] * self.scale[2]))

			# add to self list
			self.hitable_list.append(hitable)
예제 #2
0
	def setAttenuation(self, coeff: Vec3f) -> None:
		assert self._ops_tracer is not None
		data: bytes		= coeff.convertToBytes()
		result:	int		= self._ops_tracer.Light_config(self.object_index, 0, data)
예제 #3
0
	def setOrientation(self, orientation: Vec3f) -> None:
		assert self._ops_tracer is not None
		data:	bytes	= orientation.convertToBytes()
		result: int		= self._ops_tracer.Light_config(self.object_index, 0, data)
예제 #4
0
 def setBoardSize(self, size: Vec3f) -> None:
     data: bytes = size.convertToBytes()
     result: int = self._ops_tracer.Texture_config(self._object_index, 0,
                                                   data)
예제 #5
0
 def setMultiplier(self, value: Vec3f) -> None:
     data: bytes = value.convertToBytes()
     result: int = self._ops_tracer.Texture_config(self.object_index, 0,
                                                   data)
예제 #6
0
 def setPoint_2(self, point: Vec3f) -> None:
     data: bytes = point.convertToBytes()
     result: int = self._ops_tracer.Hitable_config(self.object_index, 2,
                                                   data)
예제 #7
0
 def setCenter(self, center: Vec3f) -> None:
     data: bytes = center.convertToBytes()
     result: int = self._ops_tracer.Hitable_config(self.object_index, 0,
                                                   data)