PDA

View Full Version : wrml loader and normals problems



Fernando Cab
05-02-2011, 11:10 AM
Hello to all Dev's..
Just new around here, soory for my lack of knowledge..
I've got a couple of questions here. stock for a while before posting.

1. I've implement a wrml loader and found that the normal index and coord index from Maya sometimes came with 4 values. The question is that i manage to read the 3 values when usually happens, but not load properly with the fourth one. i've done something like..
fscanf(fp,"%d %d %d %d %d",&(ind[i]), &(ind[i+1]), &ind[i+2], &ind[i+3],&temp);
Read them but not in correct order.

2. How to load the Normals and the coordinates from a wrml loader from Max.

I manage to load the mesh but not the normals and coordinates acording
int i,j;
for (j=0;j<noofshapes;j++)
{
for (i=0;i<noofpoly[j]*3;i=i+3)
{
glBegin(GL_TRIANGLES);
//glNormal3f( &amp;(norms[j][3*nindices[j][i])); I've try this
glVertex3fv(&amp;(coords[j][3*indices[j][i]]));
//glTexCoord2f.. what in here?
glVertex3fv(&amp;(coords[j][3*indices[j][i+1]]));
//glTexCoord2f.. what in here?
glVertex3fv(&amp;(coords[j][3*indices[j][i+2]]));
//glTexCoord2f.. what in here?
glEnd();
}
}

And if someone can point me to tutorials about OpenGl and games even paid ones?

Thanks in advance
and sorry for my In glish ;)

Fernando Cab
05-03-2011, 01:44 PM
Sorry maybe i did not express myself correctly? or is wrong place?

I'm looking for some reference clues or something on.. how about to texture a mesh imported from a format.. vrml file, or any other like 3ds, fbx, obj.

I've been looking around but did not find anything very clear..

Sorry for my lack of knowledge.

please clues I'm very stuck