Is there anyway to get texture coords from heightmap vertex data?
What I mean is, can/how are texture coords from drawing a texture over the entire terrain, obtained from the terrains vertex data.
To actually state the question properly; how do you generate texture coords for a heightfield terrain?
terrain rendering code:
Code:glBegin(GL_TRIANGLES); for(NxU32 i=0;i<HEIGHTFIELD_NB_FACES;i++) { glNormal3fv(&gHeightfieldNormals[gHeightfieldFaces[i*3+0]].x); glVertex3fv(&gHeightfieldVerts[gHeightfieldFaces[i*3+0]].x); glNormal3fv(&gHeightfieldNormals[gHeightfieldFaces[i*3+1]].x); glVertex3fv(&gHeightfieldVerts[gHeightfieldFaces[i*3+1]].x); glNormal3fv(&gHeightfieldNormals[gHeightfieldFaces[i*3+2]].x); glVertex3fv(&gHeightfieldVerts[gHeightfieldFaces[i*3+2]].x); } glEnd();



LinkBack URL
About LinkBacks



