Here is my code:
Code: Select all
Private Function plotarBoia(ByVal g As Steema.TeeChart.Drawing.Graphics3D) As Boolean
Try
'// center position
Dim Xcentro As Integer = g.ChartXCenter + g.RotationCenter.X
Dim Ycentro As Integer = g.ChartYCenter + g.RotationCenter.Y
Dim Zcentro As Integer = (tChart.Aspect.Width3D / 2) + g.RotationCenter.Z
g.Brush.Solid = True
g.Brush.Visible = True
g.Pen.Visible = True
g.Pen.Width = 1
g.Pen.Color = Color.Black
Dim rect As System.Drawing.Rectangle
'Parte de baixo
g.Brush.Color = Color.Orange
rect = New System.Drawing.Rectangle(Xcentro - 96, Ycentro + 22, 192, 43)
g.Cone(True, rect, Zcentro - 96, Zcentro + 96, True, 100)
''Parte do meio
g.Brush.Color = Color.Gray
rect = New System.Drawing.Rectangle(Xcentro - 104, Ycentro + 10, 208, 12)
g.Cone(True, rect, Zcentro - 104, Zcentro + 104, True, 100)
'Parte de cima
g.Brush.Color = Color.Orange
rect = New System.Drawing.Rectangle(Xcentro - 96, Ycentro, 192, 10)
g.Cone(True, rect, Zcentro - 96, Zcentro + 96, True, 100)
Dim m(4) As Drawing.Point3D
g.Brush.Color = Color.Yellow
m(0) = New Steema.TeeChart.Drawing.Point3D(Xcentro - 50, Ycentro - 135, Zcentro) 'sup. dir.
m(1) = New Steema.TeeChart.Drawing.Point3D(Xcentro - 50, Ycentro - 20, Zcentro) 'inf. dir.
m(2) = New Steema.TeeChart.Drawing.Point3D(Xcentro - 100, Ycentro - 20, Zcentro) 'inf. esq.
m(3) = New Steema.TeeChart.Drawing.Point3D(Xcentro - 100, Ycentro - 40, Zcentro) 'int. esq.
m(4) = New Steema.TeeChart.Drawing.Point3D(Xcentro - 70, Ycentro - 135, Zcentro) 'sup. esq.
g.Polygon(m)
g.Pen.Width = 1
'mastro
g.Brush.Color = Color.Gainsboro
rect = New System.Drawing.Rectangle(Xcentro - 50, Ycentro - 155, 8, 155)
g.Cone(True, rect, Zcentro - 4, Zcentro + 4, True, 100)
Dim p(3) As System.Drawing.Point
p(0) = New System.Drawing.Point(Xcentro - 60, Ycentro - 155)
p(1) = New System.Drawing.Point(Xcentro - 30, Ycentro - 155)
p(2) = New System.Drawing.Point(Xcentro - 30, Ycentro - 155)
p(3) = New System.Drawing.Point(Xcentro - 60, Ycentro - 155)
g.Plane(Zcentro - 25, Zcentro + 25, p)
g.Brush.Color = Color.White
'est. met.
rect = New System.Drawing.Rectangle(Xcentro - 55, Ycentro - 195, 4, 40)
g.Cone(True, rect, Zcentro + 18, Zcentro + 22, True, 100)
'gps
rect = New System.Drawing.Rectangle(Xcentro - 39, Ycentro - 175, 4, 20)
g.Cone(True, rect, Zcentro + 18, Zcentro + 22, True, 100)
'sinalizador
rect = New System.Drawing.Rectangle(Xcentro - 51, Ycentro - 190, 12, 35) '45
g.Cone(True, rect, Zcentro - 6, Zcentro + 6, True, 100)
'
rect = New System.Drawing.Rectangle(Xcentro - 40, Ycentro - 165, 6, 10)
g.Cone(True, rect, Zcentro - 23, Zcentro - 17, True, 100)
'antena
rect = New System.Drawing.Rectangle(Xcentro - 55, Ycentro - 200, 4, 45)
g.Cone(True, rect, Zcentro - 22, Zcentro - 18, True, 100)
Return True
Catch ex As Exception
Return False
End Try
End Function