es () mmn.createcameraview=True Then=0=0=0=mmn.TrackBar1.Value=mmn.TrackBar2.Value=mmn.TrackBar3.ValueIffAngle As Single=(2.0F * Math.PI) / 360zAngel As Single=(2.0F * Math.PI) / 360xAngel As Single=(2.0F * Math.PI) / 360.Transform.World1=Matrix.Multiply (Matrix.RotationY (fAngle), Matrix. RotationZ (zAngel)). Transform.World1=Matrix.Multiply (device.Transform.World1, Matrix.RotationX (xAngel)). Transform.World=device.Transform.World1mmn.createcameraview=True Thenl As Double=Math.Sqrt (mmn . NumericUpDownCX.Value ^ 2 + mmn.NumericUpDownCY.Value ^ 2 + mmn.NumericUpDownCZ.Value ^ 2). Transform.View=Matrix.LookAtLH (New Vector3 (mmn.NumericUpDownCX.Value * 1.0F, mmn.NumericUpDownCY.Value * 1.0F + 8,-mmn.NumericUpDownCZ.Value * 1.0F), New Vector3 (0.0F, 8.0F, 0.0F), New Vector3 (0.0F, 1.0F, 0)). Transform.Projection=Matrix.PerspectiveFovLH ( 2 * Math.Atan ((16/2) / l), mx / kol_y, 1.0F, 100.0F). Transform.View=Matrix.LookAtLH (New Vector3 (40.0F + RA, 40.0F + RB, - 40.0F + RC), New Vector3 (0.0F, 0.0F, 0.0F), New Vector3 (0.0F, 1.0F, 0)). Transform.Projection=Matrix.PerspectiveFovLH (CSng (Math.PI) / 4, 1.0F, 1.0F, 1000.0F) IfSub 'SetupMatrices
«Процедура проверокFunction TryF () mmn.Text =« » Then »Перевірка на втрату пріложенія.Close (). Close ()« Вихід! Ifmmn.NewResolution Then »Перевірка на нове расшіреніе.ClientSize=New System.Drawing.Size (mmn.fWidth (0), mmn.fHeight ( 0)). NewResolution=False.NewRast=True
End Ifmmn.statW=«CreateBMPbrowser» Then" Перевірка на необхідність створити. Hide ()» додаток BMPbrowser.Hide ()
Dim mbrow As New BMPBrowser (). Show (). PictureBox1.Size=New System.Drawing.Size (mmn.fWidth (0), mmn.fHeight (0)). ClientSize=New System . Drawing.Size (120 + mmn.fWidth (0), 0 + mmn.fHeight (0)). PictureBox1.Location=New System.Drawing.Point (120, 0). Location=New System.Drawing.Point (300 , 0) mbrow.Created.DoEvents () While.PictureBox1.Dispose (). Dispose (). Show (). Show (). statW=«» Ifmmn.createcameraviewA=1 Then.autocreatall (). createcameraviewA=0 . SomeChange=False.refreshwindow=TrueIfmmn.createcameraviewA=2 Then.createcameraview=True.createcameraviewM=True.MRast=True.refreshwindow=True.createcameraviewA=1Ifmmn.createcameraviewA=3 Then.createcameraview=True.refreshwindow=True.createcameraviewA=2IfFunctionSub InitializeComponent (). SuspendLayout ()
«» rendering
'Me.ClientSize=New System.Drawing.Size (292, 273). Name=«rendering». ResumeLayout (False) SubOverrides Sub Finalize (). Close (). Finalize () SubSub Rendering_Paint (ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint.refreshwindow=TrueSubSub Rendering_KeyPress (ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase . KeyPressAsc (e.KeyChar)=CInt (System.Windows.Forms.Keys.Escape) Then
Me.Close () Вихід при натисканні на Esc
End IfSubSub Main () frm As New rendering () «Створюємо вікно renderingNot frm.InitializeGraphics () Then Initialize Direct3D.Show (« Could not initialize Direct3D. ») If.Show () frm.Created.Render (). DoEvents (). TryF () WhileSub »MainClassNamespace
Додаток В
Лістинг модуля «BMPBrowser.vb»
Public Class BMPBrowserSystem.Windows.Forms.Formstat As Boolean=Falsez As I...