Simplest polygon data file format?


#1

Hello all,

I am working on a simple raytracing engine as a personal project. So far, I’ve been entering test scene geometry by hand. This is getting old, though, and at the top of my list of things to implement is the capability to ingest scene geometry exported from a modeling program, preferably Blender because it’s free and I have it. It seems to support exporting a number of different formats.

I have no desire to deal with complicated data structures at this point. It will be sufficient for me to simply import individual vertices, faces, triangles, edges, or whatever. So the file format I choose needs to either a) be simple enough for me to implement my own read routines for it or b) have open source libraries available for reading it in and getting me what I need.

If it sounds like I don’t know what I’m talking about, it’s because I don’t know what I’m talking about. I have no 3D modeling experience or experience building computer graphics systems of any kind. All my work so far is either out of my own head or from the pages of Wikipedia. So, please excuse my extreme ignorance.

tl;dr: I am writing a raytracing engine. I need a simple file format for importing scene geometry in the form of triangles. What is the best format for this purpose?


#2

OBJ is the most common geometry format for polygonal data - most 3D packages can read or write OBJ files.

http://en.wikipedia.org/wiki/Obj


#3

This looks like just the ticket… thanks much.


#4

Yes, I would also go with obj or collada. You could also try Assimp which can read several formats. I actually use it for my RT, though I have problems with speculars which prevent me from having a specular (not reflective) term in my scenes. I did not check recent releases though, so maybe now it is better.

A fast way to import models of several formats (even blender, looking at the changelog)


#5

obj is the best for an express solution. i have an obj reader for triangle if you want one.


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.