void ExportMeshes() { // Example on how to export it meshes in wavefront obj format Mesh m0; UVSphere(22, 11, m0); exportObj(m0, "uvsphere.obj"); Mesh m1; NormalizedCube(6, m1); exportObj(m1, "ncube.obj"); Mesh m2; SpherifiedCube(6, m2); exportObj(m2, "scube.obj"); { Mesh m3; Mesh m4; Mesh m5; Icosahedron(m3); SubdivideMesh(m3, m4); SubdivideMesh(m4, m5); exportObj(m5, "icosahedron.obj"); } }
Window::Window(QWidget *parent) : QMainWindow(parent) { setWindowTitle(tr("CPSC589 - 3d Modelling with Kinect")); renderView = new RenderView(); mainLayout = new QGridLayout; controlLayout = new QVBoxLayout(); pause_button = new QPushButton("Pause"); pause_button->setCheckable(true); connect(pause_button, SIGNAL(toggled(bool)), renderView, SLOT(pause(bool))); connect(renderView, SIGNAL(pausePlease()), this, SLOT(setPaused())); exportObj_button = new QPushButton("Export .obj"); connect(exportObj_button, SIGNAL(clicked()), renderView, SLOT(exportObj())); exportPly_button = new QPushButton("Export .ply"); connect(exportPly_button, SIGNAL(clicked()), renderView, SLOT(exportPly())); exportXyz_button = new QPushButton("Export .xyz"); connect(exportXyz_button, SIGNAL(clicked()), renderView, SLOT(exportXyz())); exportPcd_button = new QPushButton("Export .pcd"); connect(exportPcd_button, SIGNAL(clicked()), renderView, SLOT(exportPcd())); dump_button = new QPushButton("Dump data"); connect(dump_button, SIGNAL(clicked()), renderView, SLOT(dump())); /* front and rear depth buffer cutoffs */ QSlider *rearCutoffPlane = createCutoffSlider(); connect(rearCutoffPlane, SIGNAL(valueChanged(int)), renderView, SLOT(setRearCutoff(int))); QSlider *frontCutoffPlane = createCutoffSlider(); connect(frontCutoffPlane, SIGNAL(valueChanged(int)), renderView, SLOT(setFrontCutoff(int))); controlLayout->addWidget(pause_button); controlLayout->addWidget(exportObj_button); controlLayout->addWidget(exportPly_button); controlLayout->addWidget(exportXyz_button); controlLayout->addWidget(exportPcd_button); controlLayout->addWidget(new QLabel(tr("Rear Cutoff Plane"))); controlLayout->addWidget(rearCutoffPlane); controlLayout->addWidget(new QLabel(tr("Front Cutoff Plane"))); controlLayout->addWidget(frontCutoffPlane); controlLayout->addWidget(dump_button); mainLayout->addWidget(renderView, 0, 1, 2, 2); mainLayout->addLayout(controlLayout, 0, 3, 1, 2); centralWidget = new QWidget; setCentralWidget(centralWidget); centralWidget->setLayout(mainLayout); rearCutoffPlane->setValue(10*100); frontCutoffPlane->setValue(0); renderView->setStatusBar(statusBar()); }