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

'draw the front of the box in the stationary view

DrawShape Sides (0), PicXY, "FRONT"

'repeat loop 6 times once for each side the rotation of each point must

'be calculated to find the new position of the normal of each side to

'determine if it's visible

For j = 0 To 5

'*********************************************************

'draw the points for a top to bottom rotation (rotation around

'the X axis)

'*********************************************************

For i = 0 To Sides (0). NumPoints

XSides (j). NumPoints = Sides (0). NumPoints

XSides (j). Points (i). X = Sides (j). Points (i). X 'new x value

XSides (j). Points (i). Y = Sides (j). Points (i). Y * CosAng (Angle) - Sides (j). Points (i). Z * SinAng (Angle) 'new y value

XSides (j). Points (i). Z = Sides (j). Points (i). Z * CosAng (Angle) + Sides (j). Points (i). Y * SinAng (Angle) 'new z value

XSides (j). Normal. X = Sides (j). Normal. X

XSides (j). Normal. Y = Sides (j). Normal. Y * CosAng (Angle) - Sides (j). Normal. Z * SinAng (Angle) 'new y value

XSides (j). Normal. Z = Sides (j). Normal. Z * CosAng (Angle) + Sides (j). Normal. Y * SinAng (Angle) 'new z value

Next i

'check to see if plane is visible if so draw it

If VisiblePlane (XSides (j), 0, 0, 1000) Then

'Draw lines in top, top to bottom rotation

DrawShape XSides (j), PicFTB, "FRONT"

End If

If VisiblePlane (XSides (j), 1000, 0, 0) Then

'Draw points in side, top to bottom rotation view

DrawShape XSides (j), PicSTB, "SIDE"

End If

'*********************************************************

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