
Model Loaders
Posted Thursday, 31 July, 2008 - 14:41 by flopoloco inHello, do you know if someone programmer made an OpenTK model loader available to public? Currently I could use one "already-made" because I am developing some game examples. ;-)
P.S. Is there any general planning for OpenTK supporting model loaders? I would like to get my hands dirty with "Collada".


Comments
Re: Model Loaders
I wrote a model loader that supports milkshape files with skeletal animation, but I haven't finished the animation controller yet, so you can't do anything more advanced then loop the animation.
Re: Model Loaders
Cool, I hope you finish it soon, making OpenTK even better. ;-)
Re: Model Loaders
There's a couple of heavy problems when it comes to loading models, which is why there's no solution for this in OpenTK atm.
...to give some extreme examples.
Long story short, we didn't find a common denominator that would please everyone. With the upcoming OpenGL 3 the issue of the Vertex declaration might be not a problem anymore, so at very least a plugin architecture for loading static models could become reality.
Playing back skeletal animation - especially modes for mixing several animations with each other - is a fairly complex topic, and might never be part of OpenTK.
Re: Model Loaders
If you want to see where the Milkshape loader is right now, check out http://www.robotechmmo.com/Video/beta1.ogg or http://www.robotechmmo.com/Video/beta1.avi
Re: Model Loaders
@Inertia: I have been experimenting with a possible solution for the represantation of abstract "Vertex" types, as part of an api abstraction for my diploma thesis. The basic idea is that structs can implement interfaces (so in the above example, both structs are instances of an IVertex type). You can then have generic IVertexBuffers of IVertex structs, which can be drawn as-is (DrawArrays) or using IElementBuffers (DrawElements).
I will make a post with source code soon, as soon as I work out some basic implementation details.
(Yeah, that was a bit off-topic :) )
Re: Model Loaders
Here is my vertex struct and the code to render it. Personally, I've never really liked the various vertex definition systems that I've seen. Anyone who can understand them can understand this and this has more efficiency and flexibility.
Here is how I render it. Its not alot of code.
Re: Model Loaders
I am trying to port the 3DS loader to C# but I am stuck :(
Could anyone port this into C#?
http://www.flipcode.com/archives/3dsloader.cpp
Re: Model Loaders
That looks like a pretty straight forward port, but it looks like it only contains vertex position and index data. I don't see the material info, texture coordinates, or any animation data.
Is that what you wanted?
Re: Model Loaders
Yes, this is a simple and quick way for starting out.
I hope one example will "open my eyes" to make OpenTK full support 3DS files, specifically, how to make it work the C# way...;-)
Generally, if you have any resources on loaders for C# or Java please let me know.
Thanks.
Re: Model Loaders
I have been writing some utility classes that consume OpenTK. The source is available at https://sourceforge.net/projects/oogl/.
Can you give me a sample file to parse and I will try to port the code you requested when I get a chance.