Лабораторная работа: Greating 3D-Graphics on visual basic
' ZSides (j). Points (i). Z = Sides (j). Points (i). Z 'new z value
' ZSides (j). Normal. X = Sides (j). Normal. X * CosAng (Angle) + Sides (j). Normal. Y * SinAng (Angle) 'new x value
' ZSides (j). Normal. Y = Sides (j). Normal. Y * CosAng (Angle) - Sides (j). Normal. X * SinAng (Angle) 'new y value
' ZSides (j). Normal. Z = Sides (j). Normal. Z 'new z value
'Next i
'Rotate values rotated in X direction in Z direction to make "spinning effect"
For i = 0 To Sides (0). NumPoints
Sides3D (j). NumPoints = Sides (0). NumPoints
Sides3D (j). Points (i). X = XSides (j). Points (i). X * CosAng (Angle) + XSides (j). Points (i). Y * SinAng (Angle) 'new x value
Sides3D (j). Points (i). Y = XSides (j). Points (i). Y * CosAng (Angle) - XSides (j). Points (i). X * SinAng (Angle) 'new y value
Sides3D (j). Points (i). Z = XSides (j). Points (i). Z 'new z value
Sides3D (j). Normal. X = XSides (j). Normal. X * CosAng (Angle) + XSides (j). Normal. Y * SinAng (Angle) 'new x value
Sides3D (j). Normal. Y = XSides (j). Normal. Y * CosAng (Angle) - XSides (j). Normal. X * SinAng (Angle) 'new y value
Sides3D (j). Normal. Z = XSides (j). Normal. Z 'new z value
Next i
'check to see if plane is visible if so draw it
If VisiblePlane (Sides3D (j), 0, 1000, 0) Then
'Draw the 2 direction rotation
DrawShape Sides3D (j), Pic3D, "TOP"
End If
Next j
'draw centerpoint of each picbox in Blue
PicXY. Circle (Center. X, Center. Y), 30, RGB (0, 0, 255)
PicFRL. Circle (Center. X, Center. Y), 30, RGB (0, 0, 255)
PicTop. Circle (Center. X, Center. Y), 30, RGB (0, 0, 255)
PicFTB. Circle (Center. X, Center. Y), 30, RGB (0, 0, 255)
PicSTB. Circle (Center. X, Center. Y), 30, RGB (0, 0, 255)
Pic3D. Circle (Center. X, Center. Y), 30, RGB (0, 0, 255)
End Sub