earth science期刊:如何在vb下做3维图形?

来源:百度文库 编辑:高考问答 时间:2024/04/29 19:47:16
一个软件计算得到很多数据,结果保存在一个数据库中,想从该库接收数据把结果可视化为3维空间图形,请问如何做?

这个我无法做...

只能提供你一个做3D视图的代码,你试着改改看

首先要建立一个COMMAND,和一个PICTURE

代码为:

Private Sub Command1_Click()
Dim PI, circStart, circEnd, gPercent, jPercent, nX, nY, rad
nX = Picture1.ScaleWidth \ 2
nY = Picture1.ScaleHeight \ 2

rad = 1000
gPercent = 75
jPercent = 25

PI = 22 / 7
circStart = (gPercent * PI) / 180
circEnd = (jPercent * PI) / 180

Picture1.DrawWidth = 1
Picture1.FillStyle = 0
Picture1.FillColor = vbBlue
'The For - Next is not nested for clarity
For i = 1 To 200
Picture1.Circle (nX, nY), rad, vbRed, -circStart, -circEnd, -1
nX = nX + 1
nY = nY + 1
Next i

Picture1.FillColor = vbRed
For j = 1 To 200
'Adjusting the nX and nY moves the wedge
Picture1.Circle (nX + 200, nY - 500), rad, vbBlue, -circEnd, -circStart, -1
nX = nX + 1
nY = nY + 1
Next j

End Sub