I'm trying to make a cube with rounded corners in OpenGL, much like a die if you were to sand down the corners, or one of those novelty stuffed chairs.
Bezier curves seem to be the best way to go about this to my understanding, but I'm sure how to stitch them together to form a cube like I want. I've had some success putting two Bezier curves together to make a "flat fish-like" triangular solid (see code below), but I always get some weird non-convex abomination whenever I try to extend it to a cube.
//Draw left side of fish
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &ctrlptsLeft[0][0][0]);
glMapGrid2f(uSteps, 0.0, 1.0, vSteps, 0.0, 1.0);
glEvalMesh2(GL_FILL, 0, uSteps, 0, vSteps);
//Draw right side of fish
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &ctrlptsRight[0][0][0]);
glMapGrid2f(uSteps, 0.0, 1.0, vSteps, 0.0, 1.0);
glEvalMesh2(GL_FILL, 0, uSteps, 0, vSteps);
/* uSteps and vSteps are defined elsewhere as constants - the number of steps to use in drawing the surface. Likewise, the control point arrays are similarly defined elsewhere.*/
For the cube, specifically I am wondering how many control point arrays I should need to fully define it (I'm assuming I need 6 surfaces and thus 6 arrays, though if there is a simplification I can make to use less, please let me know), and how can I map them to form a cube shape?