三维坐标如何转换成二维的?

来源:百度知道 编辑:UC知道 时间:2024/05/17 03:25:14
一个三维的点(x,y,z)如何转换成一个二维的点坐标(x,y)?不要理论,直接说转换函数表达式。

那要看怎么投影了
直接去掉z坐标也是变成2D的,只不过是把z坐标都压缩在一个平面了
下面的是轴测图
Option Base 1
Private Type LineNum
sP As Integer
eP As Integer
End Type
Dim px(), py(), pz()
Dim pt(12, 4)
Dim ln(18) As LineNum
Dim lp1(6) As POINTAPI

Private Sub Form_Load()
Show
px = Array(-180, -320, -320, -250, -250, -180, -180, -320, -320, -250, -250, -180)
py = Array(0, 0, 0, 0, 0, 0, 120, 120, 120, 120, 120, 120)
pz = Array(50, 50, 110, 110, 200, 200, 50, 50, 110, 110, 200, 200)
pl = Array(1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 1, 7, 8, 8, 9, 9, _
10, 10, 11, 11, 12, 12, 7, 1, 7, 2, 8, 3, 9, 4, 10, 5, 11, 6, 12)
For i = 1 To 12
pt(i, 1) = px(i)
pt(i, 2) = py(i)
pt(i, 3) = pz(i)
pt(i, 4) = 1
Next
For i = 1 To 18
ln(i).sP = pl(2 * i - 1)
ln(i).eP = pl(2 * i)
Next i

Dim t0(4, 4), t(4, 4), p(12, 4)
Unit3D t0()
zhouce t
Mat3D t0(), t()