Jump to content
  • Advertisement
Sign in to follow this  
amigo1970

wrml loader and normals problems

This topic is 2603 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello to all Dev's..
Just new around here, sorry for my lack of knowledge..
I've got a couple of questions here. stock for a while before posting.

1. I've implement a vrml 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), &(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've try this
glVertex3fv(&(coords[j][3*indices[j]]));
//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 wink.gif

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!