PDA

View Full Version : 3D Object Texturing



stefanpaulp
12-15-2014, 02:29 PM
I'm new to openGL and I'm trying to put a texture over a 3D GLMmodel object(a dinosaur) but I can't make it work.
This is how I load the dinosaur:
void drawModel(GLMmodel **pmodel,char*filename,GLuint mode)
{
if(!*pmodel)
{
*pmodel=glmReadOBJ(filename);
if(!*pmodel)exit(0);
glmUnitize(*pmodel);
//generate facet normal vectors for model
glmFacetNormals(*pmodel);
//generate vertex normal vectors (called after generating facet normals)
glmVertexNormals(*pmodel,90.0);

}

glmDraw(*pmodel,mode);

}

I was wondering if annyone could help me with a bit of code or explanations...
Thanks.