vb.net三维 vbnet ui( 二 )


End Sub
Public Sub Render() ‘调用它画图
Dim vlook As New Vector3(1, 0, 0)
Dim vPos As New Vector3(0,0,0)
Dim vUp As New Vector3(0, 0, 1)
MatView = Matrix.LookAtLH(vPos, vlook, vUp) ‘计算摄像机位置矩阵
Device.SetTransform(Direct3D.TransformType.View, MatView) ‘设置当前摄像机位置矩阵为MatView 。
Dim fAspect As Single = Me.Width / Me.Height ’窗口长宽比
matProj = Matrix.PerspectiveFovLH(Math.PI / 4, fAspect, 1.0F, 10001) ‘计算透视矩阵MatProj 。
MyDevice.SetTransform(Direct3D.TransformType.Projection, matProj) ‘设置当前透视矩阵为MatProj 。
MyDevice.Clear(Direct3D.ClearFlags.Target + Direct3D.ClearFlags.ZBuffer, Color.Blue, 1.0F, 0) ’先刷蓝屏
MyDevice.BeginScene() ‘开始画
MatWorld = Matrix.Identity ’物体位于原点,不旋转
Device.SetTransform(Direct3D.TransformType.World, MatWorld) ’设置物体位置
Me.Mesh.DrawSubset(0) ‘画物体
MyDevice.EndScene() ’结束
MyDevice.Present() ‘显示在屏幕上
End Sub
Public Sub DeleteDeviceObjects() ’结束程序时放掉资源
MyPlane.Dispose()
MyDevice.Dispose()
End Sub
#End Region
Private Sub FormMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
DeleteDeviceObjects()
Windows.Forms.Cursor.Show()
End Sub
Private Sub FormMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
InitDeviceObjects()
RestoreDeviceObjects()
Windows.Forms.Cursor.Hide()
Render()
End Sub
End Class
怎么利用VB.NET实现三维绘图数学上不是有斜二测画法,算好坐标即可画出
或者用AnyCAD的.Net图形控件
也可以调用matlab 实现
关于vb.net三维和vbnet ui的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。

推荐阅读