openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.97k stars 2.55k forks source link

better 3D model loader #148

Closed ofTheo closed 13 years ago

ofTheo commented 14 years ago

Collada is dope - but might be too heavy? There is OBJ out there that handles textures - ask Keith?

simongeilfus commented 14 years ago

Hi Theo, Actually Collada is definitely a good idea!!!

I would be pleased to help writing a lighter library to import collada files. I already wrote something that works pretty well with Cinema 4D. Well I just started so it's not really complete and it does not support animations for now, but I would love to push it further!

Another great thing about collada, is that it can be used for lot more than rendering. I see it more like a huge library file. It can store almost every types of assets for any 2D/3D application. So it could be nice to have that kind of structure to load and save 3D nodes/geometries/cameras/textures/materials (and even shaders I think)!

Tell me what you think, and I can show you what I already have...

Take care, Simon.

ofTheo commented 14 years ago

Hey Simon,

Sounds great! Would love to get help on this. Also would love to see what you have already.

Thanks! Theo

simongeilfus commented 14 years ago

Great!

What's the best way to start? Should we start a repository somewhere? Should we discuss this here, or should I start a thread on the forum? Anyway I guess it will be to early to integrate such an addon in the 007 release but it is definitely a good thing to have something like that for openframeworks!

Tell me what you think! Simon. PS: I'll upload some files tonight when I come back home, and post the links here!

ofTheo commented 14 years ago

Hey!

Yes! Would be good if you want to start a github repo. Forum might be better to discuss the project - or we can create issues in your repo page instead. Either is fine with me!

Thanks so much! Theo

simongeilfus commented 14 years ago

Hey Theo! I'm afraid I wont be able to do anything until next week! Big deadlines this week! Anyway I wrote a little example with one of the first version of my Collada implementation I've made... The newest needs a lot of cleaning first!

It's pretty basic, it just import all the geometry nodes and materials (the textures should be working too, but I'm not sure if I ever tryed that!). But it's pretty cool because you can access and draw things independently or all together.

It is using VBO so it's pretty fast (The last version is even faster, using octrees and frustum culling). Right now it just support Cinema4D Colladas, with triangles or quads. The code depends on ofxVectorMath, ofxXmlSettings and on 3 little classes I'm using with my opengl applications...

http://kinesis.be/TEMP/Collada.zip (The example was tested on windows xp only!)

For the next versions I would love to separate completely the rendering from the library / data structure part!

I'm glad to be able to help! I keep you updated next week! Simon.

simongeilfus commented 14 years ago

PS: ColladaLoader and ColladaScene are useless! I'm not sure why they are still there! :)

ofTheo commented 14 years ago

cool - just checked this - tried the duck.dae and duckCM.tga and it worked great once I vertically flipped the tga texture. ( https://collada.org/owl/browse.php?sess=0&parent=126&expand=1&order=name&curview=0&sortname=ASC )

tried an animated dae and that didn't work but I imagine thats to be expected.

what do you have on the list for this addon?

simongeilfus commented 14 years ago

Hello Theo! After spending the last days fighting my way back home in trains and bus, I'm back! Actually I started this addon in the same idea as ofxSVG (I'm about to redesign this one too) ... I want to bring to OF the good thing of having a minimal 2D and 3D scenegraph that you could edit with your favorite software.

So my idea is to re-write the two addons the same way; split them in two parts; The first one should looks like ofxXMLSetting and have a node structure storing everything you need. Be able to load and save everything (Joshua already did the save part for ofxSVG :) ). Maybe some good sort and search algorithm would be usefull too in this part?

Then the second part would be the renderer. I quite like the idea of having the choise between one big VBO containing the whole file loaded, in the case you need something really fast or if you prefer having one vbo by primitive so you can choose to render only some parts of the graph!

So for ofxCollada I would see something like that for the begining: ofxColladaLoader and ofxColladaRenderer with something like ofxColladaNode inbetween!

Right now it should support everything but animations! I guess animations would be the big next step after we build the "main things" (So Geometries, Materials, Shaders, Lights, Cameras, Matrix Nodes, Textures, Shaders, ... for the first step and the next step would be animate everything with something like ofxColladaAnimation or ofxColladaTimeline)

Tell me what you think about this! Cheers, Simon.

ofZach commented 13 years ago

ofxAssimpLoader is in the core -- so closing this.

ofZach commented 13 years ago

ofxAssimpLoader is in the core -- so closing this.