Лабораторная работа: Greating 3D-Graphics on visual basic

tmp (i). X = shape. Points (i). X + 75

tmp (i). Y = shape. Points (i). Z + 75

Next i

'Draw solid polygons

'calculate light value (ambient + Max * (normal of plane * light position)

Colr = 100 + 200 * (shape. Normal. Y)

'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 = "SIDE" 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

For i = 0 To shape. NumPoints

tmp (i). X = shape. Points (i). Z + 75

tmp (i). Y = shape. Points (i). Y + 75

Next i

'Draw solid polygons

'calculate color value (ambient + Max * (normal of plane * light position)

Colr = 100 + 200 * (shape. Normal. X)

'Fill object as solid

PicBox. FillStyle = 0

'Choose the color (this way makes a shade of yellow)

PicBox. FillColor = RGB (Colr, Colr, Colr / 2)

К-во Просмотров: 292
Бесплатно скачать Лабораторная работа: Greating 3D-Graphics on visual basic