Arxae's picture

Load models with textures

Hello, i decided to use opentk for my (small) 3d needs :) since it had the feature i needed (usable as control on a form) in a easy way.
Now the thing is, i need to load a simple 3d model (obj, but can be converted) with its textures. The model in this case is just exported from sketchup (nothing fancy)
The problem is, i don't know how :(
I looked around and i found the meshomatic project. I think i am able to load the mesh correctly (no errors) here is the code for it that i used:

 ObjLoader loader = new ObjLoader();
MeshData mesh = loader.LoadFile("test.obj");

This is done in the form load event.
The question is, how do i draw it? I am just in the testing phase atm. I followed the first drawing tutorial and it works. So the project is setup correctly.
But the tutorial just drew a 2d triangle directly :) and loading a 3d file is really different i think.

So is anyone able to help or explain me how to do it?

Thanks in advance :D


Comment viewing options

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

I'm interested too to know how I can display multiple objects (.obj exported from Sketchup).

PeterMacGonagan's picture

May be in your RenderFrame function:
you should call loader.Render();