3D model export

Hey All

Has anyone had the need to export 3D models from oF? Or any thoughts of a good library to do it with? Any reasonably well supported format would be good, obj, dxf, 3ds etc.

cheers

Marek

Solution! For anyone who needs it, I’ve ported Marius Watz’s STL file IO class to C++.

Get it here:
http://ofxmarek.googlecode.com/files/ofxSTLModel.zip

Example included.

enjoy

Marek

hey - nice work - that is really helpful!

Looks like you have a small bug in your example though -

  
			model.read("torus.stl");   

should clear its internal vector of triangles.
Currently after you do an explode then a read you get really weird results.

Theo

ack. good spot. fixed now.

I have an implementation that does .obj and .ply for point clouds and triangle meshes, as well as depth maps in image formats.

http://code.google.com/p/structured-light/source/browse/trunk/ofxStructuredLight/src/DepthExporter.h

Due to the nature of the data I’m working with, this isn’t meant for unstructured meshes or clouds – instead it’s meant for floating point depth maps with corresponding masks.

how would i start building my own model, for example a sphere with a bunch of holes?

create an empty model
add x amount of triangles
tell each triangle it’s position
?

could i use OF’s ability to make shapes in some way?

thx.s.

i started using a work around.

print out all the coordinates of the triangles and use google sketchup + ruby to assemble a model.