0
이렇게이 wikipedia page은 3D 공간에서 점의 원근 투영을 x/y 평면으로 만드는 방법을 보여줍니다. 누구든지 y/z 평면에 등가물을 수행하는 방법을 알고 있습니까?원근 투영 y/z 평면에 투영
이class Shape(object):
...
def apply_perspective(self, camera_pos, orientation, viewer_pos):
a, b, c = viewer_pos
cx, cy, cz = map(cos, orientation)
sx, sy, sz = map(sin, orientation)
transformed_vertices = []
append = transformed_vertices.append
for v in self.vertices:
x, y, z = v - camera_pos
t1 = sz*y + cz*x
t2 = cz*y - sz*x
x_ = cy*t1 - sy*z
t3 = cy*z + sy*t1
y_ = sx*t3 + cx*t2
z_ = cx*t3 - sx*t2
t4 = c/z_
newx = t4*x_ - a
newy = t4*y_ - b
append((newx, newy))
return transformed_vertices
당신은이에 있는지 특히 github repo에서에서 국지적 인 파일을 모든 코드를 볼 수 있습니다 shapes.py입니다 : (. 그냥 위키 피 디아 페이지 물건) 이것은 내가 지금 뭐하는 거지입니다.