Gere um plano com tiras triangulares
ual seria o melhor algoritmo para gerar uma lista de vértices para desenhar um plano usando tiras de triângul
Estou procurando uma função que receba a largura e a altura do plano e retorne uma matriz de flutuação contendo vértices indexados corretament
width representa o número de vértices por linh
height representa o número de vértices por colun
float* getVertices( int width, int height ) {
...
}
void render() {
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, getVertices(width,heigth));
glDrawArrays(GL_TRIANGLE_STRIP, 0, width*height);
glDisableClientState(GL_VERTEX_ARRAY);
}