I have this code and i can t use multi dimensionnal arrays beacause there s an error during the compilation who say "Incorrect Number of array dimension"...
thanks.
'Strict load3ds ("obj/mesh.3ds") Type object3ds Field vertex:Float[][] Field polygon:Int[][] Field mapCoord:Float[][] Method resizeVertex(quantity) vertex=vertex[..2] For Local l=0 To 2 vertex[l]=vertex[l][..quantity] Next End Method Method resizepolygon(quantity) polygon=polygon[..2] For Local l=0 To 2 polygon[l]=[l][..quantity] Next End Method Method resizemapCoord(quantity) mapCoord=mapCoord[..1] For Local l=0 To 1 mapCoord[l]=mapCoord[l][..quantity] Next End Method End Type '--------------------------------------------------------- Function load3ds (path:String) '--------------------------------------------------------- Local file=OpenFile(path) If file=0 Then Return 0 o:object3ds=New object3ds Local chunk_id:String,chunk_length:String,quantity:Short Local b:Byte '----------------------------------------------------------- While Not Eof(file) chunk_id:String=Hex(ReadShort(file)) chunk_length:String=Hex(Readint(file)) 'DebugLog chunk_id 'DebugLog chunk_length Select chunk_id Case "00004D4D"'no data Case "00003D3D"'no data Case "00004000"'object's name While b<>0 b=ReadByte(file) name:String=name+Chr(b) Wend Case "00004100"'empty too Case "00004110"'list od the vertices quantity=ReadShort(file) DebugLog "N vertices= "+quantity o.resizevertex(quantity) For l=1 To quantity For l2=0 To 2 o.vertex[l2,l]=ReadShort(file) Next Next Case "00004120"'faces description quantity=ReadShort(file) DebugLog "N Faces= "+quantity o:object3ds=New object3ds o.resizepolygon(quantity) For l=1 To quantity For l2=0 To 2 o.polygon[l2,l]=ReadShort(file) Next face_flag=ReadShort(file) Next Case "00004140"'coordinates list quantity=ReadShort(file) DebugLog "N Coordinates= "+quantity o.resizemapCoord(quantity) For l=1 To quantity For l2=0 To 1 o.mapCoord[l2,l]=ReadFloat(file) Next Next Default DebugLog "Default Case" For l=1 To 6 ReadByte (file) Next End Select Wend cloasefile(file) End Function '---------------------------------------------------------
thanks.