PDA

View Full Version : how to map texture?



sujudavid
11-24-2004, 01:05 AM
hi,

I have successfully converted the .flt to opengl c code, and could import and view this during the runtime.

But the problem is the textures are not loaded.I have used polytrans to convert the model, but inside this they are not loading the texture, the function is left blank.It looks something like this

//Please replace this routine with one of your //own which will load in the
//requested texture map and make it current //within the OpenGL context.
//If the texture map name is NULL then disable //texture mapping.
void OGL_Set_Current_Texture_Map(char *texture_map_name, float u_scale, float v_scale, float u_offset, float v_offset)
{
}

I am new to opengl so can someone help me filling this function up.

thanks,
Suju.

Biaspoint
09-17-2009, 09:09 PM
I have the exact same problem and have been looking for a good solution... any one with polytrans experience that can help out?

Thanks,
Mike

msqrt
09-18-2009, 07:21 AM
Well, it seems like you should write your own code to actually load the image. So search for a library that can handle that kind of stuff (SDL, if you use it for windows too, can do this easily) and write there a function to load and bind your texture. Not exactly sure what the uv_scale and uv_offsets do.. Something related to which part of the texture image it wants binded.

Biaspoint
09-19-2009, 07:17 AM
I have written the rest of the code to set everything up, window, lighting, and can produce the image with solid sides or wire frame and manipulate as I want... the only thing I can't seem to lick is the texture.

I was hoping this was a fairly common function for people that use polytrans, and didn't want to re-invent the wheel.

Thanks for the help,
Mike