Example #1
0
ofApp::ofApp():
    _nw("kaleidoSound","i-score","127.0.0.1",13579, 9998),
    _world(World3D::create()),
    _boxes(Shapes(*_world,cam ,_nw.getSceneNode(),"Boxes",ofMesh::box(20, 20, 20))),
    _balls(Shapes(*_world,cam ,_nw.getSceneNode(),"Balls",ofMesh::sphere(20)))
{

}
void stickyVertexSwitch(void) // Switch between modes without erasing vertices in progress
{
	if (currentVertices.size() > 0) {
		if (mouseMode == Dot) {
			for (int i = 0; i < currentVertices.size(); i++) {
				finishedShapes.push_back(Shapes(currentVertices[i]));
				finishedShapes.back().type = GL_POINTS;
			}
			clearCurrentVertex();
		}
		else if (mouseMode == Line) {
			for (int i = 0, j = 1; j < currentVertices.size(); i+=2, j+=2) {
				std::vector<Vertex> newLine;
				newLine.push_back(currentVertices[i]);
				newLine.push_back(currentVertices[j]);
				finishedShapes.push_back(Shapes(newLine));
				finishedShapes.back().type = GL_LINES;
			}
			clearCurrentVertex();
		}
	}
}