грани = -0.5 * CHIR: ay5 = -0.5 * GLUB: az5 = -0.5 * VIC = 0.5 * CHIR: ay6 = -0.5 * GLUB: az6 = -0.5 * VIC = 0.5 * CHIR: ay7 = 0.5 * GLUB: az7 = -0.5 * VIC = -0.5 * CHIR: ay8 = 0.5 * GLUB: az8 = -0.5 * VIC
'обертання вершин навколо Oy
'верхня грань
R = ax1 * Math.Cos (angle) - az1 * Math.Sin (angle) R = ax1 * Math.Sin (angle) + az1 * Math.Cos (angle) R = ay1
R = ax2 * Math.Cos (angle) - az2 * Math.Sin (angle) R = ax2 * Math.Sin (angle) + az2 * Math.Cos (angle) R = ay2R = ax3 * Math.Cos (angle) - az3 * Math.Sin (angle) R = ax3 * Math.Sin (angle) + az3 * Math.Cos (angle) R = ay3
R = ax4 * Math.Cos (angle) - az4 * Math.Sin (angle) R = ax4 * Math.Sin (angle) + az4 * Math.Cos (angle) R = ay4
'ніжняяграньR = ax5 * Math.Cos (angle) - az5 * Math.Sin (angle) R = ax5 * Math.Sin (angle) + az5 * Math.Cos (angle) R = ay5
R = ax6 * Math.Cos (angle) - az6 * Math.Sin (angle) R = ax6 * Math.Sin (angle) + az6 * Math.Cos (angle) R = ay6
R = ax7 * Math.Cos (angle) - az7 * Math.Sin (angle) R = ax7 * Math.Sin (angle) + az7 * Math.Cos (angle) R = ay7
R = ax8 * Math.Cos (angle) - az8 * Math.Sin (angle) R = ax8 * Math.Sin (angle) + az8 * Math.Cos (angle) R = ay8
'в екранні координати вершінD = cPX + n * ax1R/(z0 + az1R) D = cPY + n * ay1R/(z0 + az1R)
D = cPX + n * ax2R/(z0 + az2R) D = cPY + n * ay2R/(z0 + az2R) D = cPX + n * ax3R/(z0 + az3R) D = cPY + n * ay3R/(z0 + az3R)
D = cPX + n * ax4R/(z0 + az4R) D = cPY + n * ay4R/(z0 + az4R)
D = cPX + n * ax5R/(z0 + az5R) D = cPY + n * ay5R/(z0 + az5R)
D = cPX + n * ax6R/(z0 + az6R) D = cPY + n * ay6R/(z0 + az6R)
D = cPX + n * ax7R/(z0 + az7R) D = cPY + n * ay7R/(z0 + az7R)
D = cPX + n * ax8R/(z0 + az8R) D = cPY + n * ay8R/(z0 + az8R)
'Створюємо об'єкт p класу Graphics: p As Graphics = Me.CreateGraphics.Clear (Color.White)
pont () As Point = {New Point (ax1D, ay1D), New Point (ax2D, ay2D), New Point (ax3D, ay3D), New Point (ax4D, ay4D)}. DrawPolygon ( New Pen (Drawing.Color.Green, 1), pont)
pont1 () As Point = {New Point (ax5D, ay5D), New Point (ax6D, ay6D), New Point (ax7D, ay7D), New Point (ax8D, ay8D)}. DrawPolygon ( New Pen (Color.Green, 1), pont1) pont3 () As Point = {New Point (ax1D, ay1D), New Point (ax5D, ay5D), New Point (ax8D, ay8D), New Point (ax4D, ay4D) }. DrawPolygon (New Pen (Color.Green, 1), pont3)
pont4 () As Point = {New Point (ax2D, ay2D), New Point (ax6D, ay6D), New Point (ax5D, ay5D), New Point (ax1D, ay1D)}. DrawPolygon ( New Pen (Color.Green, 1), pont4)