ераcylMesh As Mesh=Nothing Штатив  
 'Основна процедура при створенні окнаSub New () 
  mmn.Show (). ClientSize=New System.Drawing.Size (400, 300). Location=New System.Drawing.Point (0, 0). Text=«3D моделювання». AutoScaleBaseSize=New System.Drawing.Size (0, 0). MaximizeBox=False.MinimizeBox=True.TopMost=True.FormBorderStyle=System.Windows . Forms.FormBorderStyle.FixedToolWindow.Location=New System.Drawing.Point (301, 0). StartPosition=System.Windows.Forms.FormStartPosition.Manual 
  End Sub 
  Спроба проініціалізувати 3D пристрій 
  Public Function InitializeGraphics () As Boolean.BackBufferCount=1 «Один задній буффер.Windowed=True» В окне.SwapEffect=SwapEffect.Discard «Вимкнути swap еффект.EnableAutoDepthStencil=True.AutoDepthStencilFormat= DepthFormat.D16=New Device (0, DeviceType.Hardware, Me, CreateFlags.SoftwareVertexProcessing, presentParams) device.DeviceCreated, AddressOf Me.OnCreateDevicedevice.DeviceReset, AddressOf Me.OnResetDevice.OnCreateDevice (device, Nothing). OnResetDevice (device, Nothing) =FalseTruee As DirectXException »Помилка при створенні! FalseTryFunction 'InitializeGraphics 
  'При створенні устройстваSub OnCreateDevice (ByVal sender As Object, ByVal e As EventArgs) dev As Device=CType (sender, Device) 
  'Створюємо вертекс робочої поверхні=New VertexBuffer (GetType (CustomVertex.PositionNormalTextured), 3 * 2 * mx * kol_y, dev, Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format, Pool.Default)=New VertexBuffer (GetType (CustomVertex.PositionNormalTextured), 3 * 2 * mx * kol_y, dev, Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format, Pool.Default)=New VertexBuffer (GetType (CustomVertex.PositionNormalTextured), 3 * 2 * mx2 * my2, dev, Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format, Pool.Default) 
  'AddHandler vertexBuffer.Created, AddressOf Me.CreateVertexBuffer 
  mmn.LStatus.Text=«Генерація об'єкта» 
  nv=0 (vertexBuffer) 
				
				
				
				
			  'Створюємо вертекс стін 
  mmn.LStatus.Text=«Генерація Об'єктів»=1 (vertexBuffer2) 
  'Створюємо вертекс уявної поверхні 
  nv=0 (vertexBufferM). LStatus.Text=«» Sub 'OnCreateDevice 
  'Налаштування 3D устройстваSub OnResetDevice (ByVal sender As Object, ByVal e As EventArgs) dev As Device=CType (sender, Device) 
  'відключення обрізань поверхностей.RenderState.CullMode=Cull.None 
  Включення света.RenderState.Lighting=True 
  Включення ZBuffer.RenderState.ZBufferEnable=True 
  'Налаштування джерела света.Lights (0). Type=LightType.Point 
  dev.Lights (0). Position=New Vector3 (0, 8, 10). Lights (0). Direction=New Vector3 (0, 0, 0). Lights (0). Diffuse =System.Drawing.Color.White.Lights (0). Range=100.0F.Lights (0). Attenuation1=0.1F.Lights (0). Commit (). Lights (0). Enabled=True 
  'Включення основного істочніка.RenderState.Ambient=System.Drawing.Color.FromArgb (& H646464)=Mesh.FromFile («. 1.x», MeshFlags.Managed, device)= Mesh.Cylinder (device, 0.05F, 0.05F, 40, 20, 20) 
  «Налаштування матеріалаmtrl As Microsoft.DirectX.Direct3D.Material.Ambient=S...