PDA

View Full Version : Map2 control point limit?



LetsGoOutside
03-20-2010, 12:10 PM
I'm render a mesh as a surface inside an openFrameworks/C++ app I'm developing. I have the control points tied to a fluid solver to make the bezier mesh move like liquid. It works great, but the mesh won't render if I have more than 32 rows / 32 columns. I need at least three times that to get the level of detail I want.

Is there a 32 row/column limit on the map2? If not, how do I get over 32? If so, I guess I can just divide the array up to multiple meshes.

+------------------------------------------------------

int columns = 32;
int rows = 32;
float screenHeight = 800;
float screenWidth = 1280;

// This is defined and populated with x, y, z coords earlier
// GLfloat grid[columns][rows][3];

// Start render
glEnable(GL_DEPTH_TEST);
surfaceShader.setShaderActive(true);
glPushMatrix();
{

// Position grid and face normal side forward
glTranslatef(screenWidth * 0.5f, screenHeight * 0.5f, 0.0f);
glRotatef(0.0f, 180.0f, 180.0f, 0.0f);

// Draw grid
glEnable(GL_MAP2_VERTEX_3);
glMap2f(GL_MAP2_VERTEX_3, 0.0, 1.0, 3, columns, 0.0, 1.0, (rows * 3), rows, &grid[0][0][0]);
glMapGrid2f(columns, 0.0, 1.0, rows, 0.0, 1.0);
glEvalMesh2(GL_FILL, 0, columns, 0, rows);

}

// Stop render
glPopMatrix();
surfaceShader.setShaderActive(false);
glDisable(GL_DEPTH_TEST);

LetsGoOutside
03-20-2010, 05:35 PM
Nevermind. Answer is yes. Limit to array size is [32][32][3]...