Grasshopper's picture

Model Loader: Current State?


I found some promissing discussions about creating a model loader for C#/OpenTK, but they all ended without results or so it seems to me.

What is the current development state?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
JTalton's picture

Gald you found it! I started to reply a couple of times, but my reply never did come together.

master2k's picture

Hi JTalon,

a quick and dirty fix would be the floatparameters / 1000000, another fix would be to replace the dots "." when parsing with a comma "," but i thougt the quick and dirty mehtod is easier to apply :), dunno wheter it's slower or faster.


c2woody's picture

another fix would be to replace the dots "." when parsing with a comma ","

I think this is due to the OS's localization setting (GUI language), so if you're parsing from a defined format (and not user input) the following is what I'm using mostly:
if (Single.TryParse(token, NumberStyles.Float, CultureInfo.InvariantCulture, out float_value)) { ... }

emacinnes's picture

I've got a modified 3DS file loader that will load the file and then put it into a Vertex Buffer Object, or a display list if VBO is unavailable, or just render it flat if all else fails.

The process is as follows, and is designed in part for multi-threaded loading of assets, hence the number of steps:

Geometry ge = new Geometry();
ge.Filename = "test.3ds";
ge.LoadFromFile(); // Can be called from another thread
ge.Finalise(); // Needs to be called from OpenGL thread, this uploads to the VBO/display list

The idea later is that this is a generic model loader, but for now only .3DS support is included.

Rendering has three options:

RenderNormalTree() and RenderDesignTree() which will render out all the geometry in either standard, or with wireframe border outlines.

The third one is RenderSelectTree() for rendering the model for selection (no textures or normals rendering, just geometry. Individual Objects from the 3DS file will be selectable, not just the entire Geometry).

If anybody's keen, drop me a note, and I'll see about working up an independent example of this. You will need the ISE.Core, ISE.System and Tao.Externals Dlls from Icarus, (available here: which can then render in OpenTK's GameWindow.



Icefox's picture

I'm interested in a general model loader type library; I wouldn't mind writing up and integrating an .obj loader for it, and maybe one or two other formats if I have time. I'd prefer to have it entirely based on OpenTK though.

Icefox's picture

Well, I got sick of waiting and started writing my own model loader library. So far it loads geometry from Milkshape 3D and Wavefront .obj files, and Collada's up next. Suggestions and contributions are welcome, of course.

Is there anything in particular I need to do to make a project page? I can't seem to figure out how to do it...

Preliminary source and such attached. Instructions are in the README.txt; the previewer was hacked together in 10 minutes from some of the OpenTK example code, so sorry that it sucks.

Meshomatic-0.0.zip60.02 KB
the Fiddler's picture

To create a project, just visit Create content -> Project< and fill in the fields. Afterwards, create a new project release to hold the zip file.

nythrix's picture

Someone announced a Collada loader some time ago and it is apparently available here.

Icefox's picture

Project is created:

Thanks a lot! I'll see if I can get anything useful from the Collada loader. Does anyone have any suggestions for other file formats that would be useful?

emacinnes's picture

I'll get the generic Renderer published shortly, just dealing with the ramifications of the Chile earthquake, and some linux issues at the moment.


Icarus Scene Engine: