Лабораторная работа: Создание 3D-графики средствами языка программирования Visual Basic
obj.polygon(3).colr = RGB (255, 0, 0)
obj.polygon(4).v_pointer(0) = 5: obj.polygon(4).v_pointer(1) = 1: obj.polygon(4).v_pointer(2) = 2
obj.polygon(4).colr = RGB (255, 0, 0)
obj.polygon(5).v_pointer(0) = 5: obj.polygon(5).v_pointer(1) = 2: obj.polygon(5).v_pointer(2) = 6
obj.polygon(5).colr = RGB (255, 0, 0)
obj.polygon(6).v_pointer(0) = 7: obj.polygon(6).v_pointer(1) = 2: obj.polygon(6).v_pointer(2) = 3
obj.polygon(6).colr = RGB (255, 0, 0)
obj.polygon(7).v_pointer(0) = 7: obj.polygon(7).v_pointer(1) = 6: obj.polygon(7).v_pointer(2) = 2
obj.polygon(7).colr = RGB (255, 0, 0)
obj.polygon(8).v_pointer(0) = 4: obj.polygon(8).v_pointer(1) = 5: obj.polygon(8).v_pointer(2) = 6
obj.polygon(8).colr = RGB (255, 0, 0)
obj.polygon(9).v_pointer(0) = 4: obj.polygon(9).v_pointer(1) = 6: obj.polygon(9).v_pointer(2) = 7
obj.polygon(9).colr = RGB (255, 0, 0)
obj.polygon(10).v_pointer(0) = 4: obj.polygon(10).v_pointer(1) = 3: obj.polygon(10).v_pointer(2) = 0
obj.polygon(10).colr = RGB (255, 0, 0)
obj.polygon(11).v_pointer(0) = 4: obj.polygon(11).v_pointer(1) = 7: obj.polygon(11).v_pointer(2) = 3
obj.polygon(11).colr = RGB (255, 0, 0)
'
End Sub
Public Sub DisplayObject (obj As Object3D, frm As Object)
Dim poly As Long
For poly = 0 To UBound (obj.polygon())
Call DrawTriangle (obj, poly, frm)
Next
End Sub
Private Sub DrawTriangle (obj As Object3D, poly As Long, frm As Object)
Dim x0 As Long, y0 As Long
Dim x1 As Long, y1 As Long
Dim x2 As Long, y2 As Long