Лабораторная работа: Создание 3D-графики средствами языка программирования Visual Basic
'
v_pointer(2) As Long
'
colr As Long
'
End Type
'
Public Type Object3D
'
vertex() As Vertex3D
polygon() As Polygon3D
'
End Type
Public Sub LoadObject (obj As Object3D)
ReDim obj.vertex(7), obj.polygon(11)
obj.vertex(0).x = -1: obj.vertex(0).y = -1: obj.vertex(0).z = -1
obj.vertex(1).x = -1: obj.vertex(1).y = -1: obj.vertex(1).z = 1
obj.vertex(2).x = 1: obj.vertex(2).y = -1: obj.vertex(2).z = 1
obj.vertex(3).x = 1: obj.vertex(3).y = -1: obj.vertex(3).z = -1
obj.vertex(4).x = -1: obj.vertex(4).y = 1: obj.vertex(4).z = -1
obj.vertex(5).x = -1: obj.vertex(5).y = 1: obj.vertex(5).z = 1
obj.vertex(6).x = 1: obj.vertex(6).y = 1: obj.vertex(6).z = 1
obj.vertex(7).x = 1: obj.vertex(7).y = 1: obj.vertex(7).z = -1
obj.polygon(0).v_pointer(0) = 0: obj.polygon(0).v_pointer(1) = 2: obj.polygon(0).v_pointer(2) = 1
obj.polygon(0).colr = RGB (255, 0, 0)
obj.polygon(1).v_pointer(0) = 0: obj.polygon(1).v_pointer(1) = 3: obj.polygon(1).v_pointer(2) = 2
obj.polygon(1).colr = RGB (255, 0, 0)
obj.polygon(2).v_pointer(0) = 4: obj.polygon(2).v_pointer(1) = 0: obj.polygon(2).v_pointer(2) = 1
obj.polygon(2).colr = RGB (255, 0, 0)