this is my first c++ and openFrameworks project. I have a cube class made from 8 vertexes, drawn in open gl and rotating in 3 dimensions. I want to be able to resize it while it is rotating. The following kind of works, but the cube shape distorts. does anyone have any ideas? the full code is available here: https://github.com/pepperminttiger/demiurge
void Cube::resizeCube(int changeInt)
{
for (int i = 0; i < NUM_VERTS; i++)
{
// move the points so that their center (ofGetW/2, ofGetH/2) is at 0,0,0
verts[i] -= cubeCenter;
// adjust the points
if (verts[i].x>0)
verts[i].x = verts[i].x+changeInt;
if (verts[i].x<0)
verts[i].x = verts[i].x-changeInt;
if (verts[i].y>0)
verts[i].y = verts[i].y+changeInt;
if (verts[i].y<0)
verts[i].y = verts[i].y-changeInt;
if (verts[i].z>0)
verts[i].z = verts[i].z+changeInt;
if (verts[i].z<0)
verts[i].z = verts[i].z-changeInt;
// move them back
verts[i] += cubeCenter;
}
}