Skip to main content
GameDev.net gamedev.net
🔒 Locked

Little help with .ase files (still unresolved)

Started by X Enterprises Sep 10, 2008 at 7:13 PM 1 replies 950+ views
Original Post
X Enterprises
X Enterprises
Hey, I'm new here and i have a question. I'm making a program for some people and i need to extract the mesh names and number of faces from an .ase file. I don't want anything else other than that. I've tried coding it myself: Public faces(0) As String Public numFaces As Integer = 0 Public names(0) As String Public numNames As Integer = 0 Public lines(0) As String Public numLines As Integer = 0 Sub Main() Console.WriteLine("ASE file (relative to the C:/ drive):") Dim line As String = "crap" Dim file As String = "C:/" + Console.ReadLine() Dim allText As String = ReadWholeFile(file) Console.Write(allText) Console.WriteLine("-- Mesh -- # Faces --") Dim reader As System.IO.TextReader = New System.IO.StreamReader(file) Do 'Array.Resize(lines, numLines) ReDim Preserve lines(numLines) lines(numLines) = reader.ReadLine() numLines += 1 Loop While Not lines(numLines - 1) = Nothing Dim i As Integer For i = 0 To numLines - 1 Step 1 If FindName(lines(i)) = True Then If Not names(numNames) = Nothing Then numNames += 1 lines(i).Remove(0, 12) lines(i).Replace("""", "") ReDim Preserve names(numNames) names(numNames) = lines(i) End If End If If FindFaces(lines(i)) = True Then If Not names(numNames) = Nothing Then numFaces += 1 lines(i).Remove(0, 15) ReDim Preserve faces(numFaces) faces(numNames) = lines(i) End If End If Next For i = 0 To numNames Step 1 Console.WriteLine(names(i) + " -- " + faces(i)) Next reader.Close() Console.ReadLine() End Sub This doesn't return anything. I'm using VB.NET. Could you help me? [Edited by - X Enterprises on September 11, 2008 5:23:08 PM]
Palidine
Palidine
I don't know VB but it looks like you're trying to read it as a text file. Lookup the File I/O stuff for reading binary files and do it that way instead

-me
X Enterprises
X Enterprises
The .ase file is not binary. It's plain text.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.