PDA

View Full Version : How to convert *.txt files to *.obj files?



babygal
30th June 2011, 09:08
Hello,
What are the methods to convert *.txt files to *.obj files and how to do it?
Is there a fast and easy method available, perhaps a ready made tool readily available ?
If got any example or link , it would be more helpful.

regards,
Emma

stampede
30th June 2011, 10:07
What .obj files do you mean ? .obj files used as mesh description in 3d modeling tools (they are already text files btw) ? Or some other .obj files, can you give example ?

babygal
30th June 2011, 10:34
What .obj files do you mean ? .obj files used as mesh description in 3d modeling tools (they are already text files btw) ? Or some other .obj files, can you give example ?
Hi,
Yes I meant .obj files used as mesh description in 3D modeling tools. Yes currently those are only in the form of text files which I am having now. Hence,the next step would be that I need a converter which could convert the text files to object files, because currently my program takes only object files as input and not text files. Unless, I write a new routine that reads text file and then render the meshes.
Currently I am looking for a way to convert the mesh text files to object files because I have an object file reader routine written already in my program.

Thank you.

regards,
Emma

stampede
30th June 2011, 10:43
(...) because currently my program takes only object files as input
Ok, so what is the format of those object files ? Or where do you get those mesh files from ? Are you exporting meshes from 3d studio ? Maybe Ogre mesh files ?

ChrisW67
30th June 2011, 11:04
...and while you are at it, what is in the txt files?

stampede
30th June 2011, 11:22
@ChrisW67: I think the mentioned .txt files are in fact .obj files, which contains description of 3d meshes ( list of vertices, faces and edges, vertex groups info and material references, all in human-readable text format ), and babygal wants to convert those text files (.obj) to some kind of binary format, which is suitable for loading in her application.
Anyway I think it could be good to ask on 3d max, blender, ZBrush, Ogre or something-related-to-3d community forum, it's more probable that you'll find help with mesh files format conversions there.
Another thing is that writing an .obj parser is quite easy task, but if you don't feel like doing it, try asking on 3d-related community forum.

ChrisW67
1st July 2011, 00:11
You could also look at MeshLab (http://meshlab.sourceforge.net/) because they seem to handle a lot of file formats of this type and the source is available.

babygal
1st July 2011, 10:25
...and while you are at it, what is in the txt files?

Hi ChrisW67,
The .txt files contain description of 3D meshes (list of vertexes and faces).

Added after 1 50 minutes:


Ok, so what is the format of those object files ? Or where do you get those mesh files from ? Are you exporting meshes from 3d studio ? Maybe Ogre mesh files ?
Hi stampede,
Sorry when you mentioned format of those object files, is it the structure you are referring to or something else?
The text mesh files are generated by my program when a certain API is called.
No, I am not exporting meshes from 3D studio.
No, not Ogre mesh files either.


regards,
Emma

wysota
1st July 2011, 14:50
Hi ChrisW67,
The .txt files contain description of 3D meshes (list of vertexes and faces).

Did you try just renaming the file from *.txt to *.obj?

stampede
1st July 2011, 14:54
is it the structure you are referring to or something else?
Yes, I am referring to a structure of the file. Is it just as simple as wysota mentioned, different extension given to the same file format :) ?