This project is read-only.

displaying the texture on an object

Oct 7, 2011 at 12:58 PM

call me nieve but i cant get the textuer to display on any object files what am i missing?

// Create a Persistence Engine.

SharpGL.Persistence.PersistenceEngine engine = new


// Destroy the existing texture.


// Create a a set of polygons.

List loaded = (List)engine.Load("Woman.cob");

// If we successfully loaded, set the collection.

if (loaded != null)


polygons = loaded;

foreach(Polygon polygon in loaded)

polygon.Attributes.PolygonDrawMode =


// Create a new texture.

texture.Create(openGLControl1.OpenGL, "Afemale copy.BMP");

// Redraw.



any help would be great im extramly new to GL

Oct 7, 2011 at 1:32 PM

It may be that the texturing coordinates are not being loaded correctly - can you send over the project and I'll take a look?

Oct 7, 2011 at 3:42 PM
Edited Oct 20, 2011 at 7:24 PM

ok i uploaded it to fileserv i know its not that good but  i didnt want to start a new topic to atach a file


Oct 7, 2011 at 4:08 PM

Great, I'll take a look over it this weekend

Oct 20, 2011 at 8:45 PM

ok so after making some changes and applying the proper settings to the control i have the ability to load the mesh but its still not reading texture,

i know you are currently working on a loading OBJ file types with MAT if i can help in any way let me know but i cant figure out how to get the texture to load

if anyone else can help me out it would be great


thanks in advance

Oct 30, 2011 at 6:46 PM

Hi cky as an update to this I now have OBJ files loading the latest cut of the code (version 7099), Example 4 from the WinForms folder can load an OBJ file - I need to get materials working with it though. Anyway, the code is there if you want an early peek at it :)

Oct 31, 2011 at 10:16 AM

dude you are awsome  ill look at it over the next few days

Oct 31, 2011 at 10:36 AM

Cool, I'm going to change the Example 4 application into a proper object loading application, allowing you to preview what you're loading. This should be a useful tool for analysing object data. Once this is done I think I'll then formally release SharpGL 2.0 (as its only in beta at the mo) I think this tool will be v useful

Oct 31, 2011 at 10:55 AM

i do too  my use for it will be displaying chactor static meshes on a project that im working on the only thing that is goign to be hard to do is overlaying meshes but ill have to work that out once i get the mesh and the materials to load then i have do a color overlay posably based on  object sections and if not then it will still just be cool to have the 3d char spinning

Oct 31, 2011 at 10:55 AM
Edited Oct 31, 2011 at 10:56 AM

dupe post

Apr 1, 2012 at 4:42 PM

I am having trouble figuring out how to load textures along with the polygons from a .OBJ file. Currently I am simply loading polygons but they are displayed as white.

Any thoughts?

Apr 2, 2012 at 5:42 AM

only one comes to mind check that you have the texter file in the obj text at the end i bleave