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( &(norms[j][3*nindices[j][i])); I've try this
glVertex3fv(&(coords[j][3*indices[j][i]]));
//glTexCoord2f.. what in here?
glVertex3fv(&(coords[j][3*indices[j][i+1]]));
//glTexCoord2f.. what in here?
glVertex3fv(&(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 ;)
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( &(norms[j][3*nindices[j][i])); I've try this
glVertex3fv(&(coords[j][3*indices[j][i]]));
//glTexCoord2f.. what in here?
glVertex3fv(&(coords[j][3*indices[j][i+1]]));
//glTexCoord2f.. what in here?
glVertex3fv(&(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 ;)