Лабораторная работа: Greating 3D-Graphics on visual basic
'rotate the rectangle
BUTNOKAY_Click
End Sub
Private Function DrawShape (shape As Verticies, PicBox As PictureBox, View As String)
' add 75 to all points to center object
'determine view
If View = "FRONT" Then
'create lppoints for the win func call
ReDim tmp (shape. NumPoints) As POINTAPI
'fill in the drawing points tmp. x as the value going in the x dir etc
For i = 0 To shape. NumPoints
tmp (i). X = shape. Points (i). X + 75
tmp (i). Y = shape. Points (i). Y + 75
Next i
'Draw solid polygons
'calculate light value (ambient + Max * (normal of plane * light position)
Colr = 100 + 200 * (shape. Normal. Z)
'Fill object as solid
PicBox. FillStyle = 0
'Choose the color (this way makes a shade of yellow)
PicBox. FillColor = RGB (Colr, Colr, Colr / 2)
'draw the polygon
Polygon PicBox. hdc, tmp (0), shape. NumPoints + 1
'draw rest of objects transparently
PicBox. FillStyle = 1
ElseIf View = "TOP" Then
'creat lppoints for the win func call
ReDim tmp (shape. NumPoints) As POINTAPI
'fill in the drawing points tmp. x as the value going in the x dir etc