Every time I run this code it shows me this message "nullreferenceexception was unhandled - Object reference not set to an instance of an object."
Public Class Point3D
Public X As Long = 0
Public Y As Long = 0
Public Z As Long = 0
End Class
Public Structure TTriangle
<VBFixedArray(2)> Public T2D() As Point2D
<VBFixedArray(2)> Public VertT3D() As Point3D
<VBFixedArray(2)> Public Real3DZ() As Long
Public Color As Color
Public IsDrown As Boolean
Public IsSelected As Boolean
Public IsIn As Boolean 'to draw or not??
Public Sub initialize()
ReDim T2D(2)
ReDim VertT3D(2)
ReDim Real3DZ(2)
VertT3D(0) = New Point3D
VertT3D(1) = New Point3D
VertT3D(2) = New Point3D
End Sub
End Structure
ReDim Preserve Triangles(zTrianglesNo)
Triangles(zTrianglesNo).VertT3D(0).X = Point1.X
Triangles(zTrianglesNo).VertT3D(0).Y = Point1.Y
Triangles(zTrianglesNo).VertT3D(0).Z = Point1.Z
How can i solve that? Thanks in advance.