I try VBO by DMA.
but it doesn’t work.
Svertex = new GLdouble**[nSlice+1];
Snormal = new GLdouble**[nSlice+1];
Scolor = new GLdouble**[nSlice+1];
Sindicesup = new GLbyte[3];
for(int i=0; i < nSlice+1; i++){
Svertex[i] = new GLdouble*[nStack+1];
Snormal[i] = new GLdouble*[nStack+1];
Scolor[i] = new GLdouble*[nStack+1];
for(int j=0; j < nStack+1; j++)
{
Svertex[i][j] = new GLdouble[3];
Snormal[i][j] = new GLdouble[3];
Scolor[i][j] = new GLdouble[3];
}
}
----------------------------------------------------------
glBufferData(GL_ARRAY_BUFFER,8*11*11*3,
Svertex,GL_DYNAMIC_DRAW);
I doubt glBufferData.(I maybe wrong ArrayPointer).
Please Help me.
Sorry My english is so poor..
The array needs to be flat. You want one
new GLdouble[3*(nStack+1)*(nSlice+1)]to pass to OpenGL. You can create pointer arrays to help you index it if you want, but the flat array will be what you pass to OpenGL.