Лабораторная работа: Создание 3D-графики средствами языка программирования Visual Basic
x2 = Cos(rol) * x1 + Sin(rol) * y1
y2 = Sin(rol) * x1 – Cos(rol) * y1
z2 = z1
obj.vertex(pnt).x = x2
obj.vertex(pnt).y = y2
obj.vertex(pnt).z = z2
Next
End Sub
Public Sub ScaleObject (xs As Single, ys As Single, zs As Single, obj As Object3D)
Dim pnt As Long
For pnt = 0 To UBound (obj.vertex())
obj.vertex(pnt).x = obj.vertex(pnt).x * xs
obj.vertex(pnt).y = obj.vertex(pnt).y * ys
obj.vertex(pnt).z = obj.vertex(pnt).z * zs
Next
End Sub
Public Sub TranslateObject (tx As Long, ty As Long, tz As Long, obj As Object3D)
Dim pnt As Long
For pnt = 0 To UBound (obj.vertex())
obj.vertex(pnt).x = obj.vertex(pnt).x + tx
obj.vertex(pnt).y = obj.vertex(pnt).y + ty
obj.vertex(pnt).z = obj.vertex(pnt).z + tz
Next
End Sub
Private FPS As Long
Private all_stop As Boolean
Private cube As Object3D
Private Sub Form_Load()
Call LoadObject(cube)