#include#include using namespace cv; int main() { // create a Plane with a size of 800x600 Plane plane(Size(800, 600)); // show the Plane on a window namedWindow("Plane"); imshow("Plane", plane); waitKey(0); destroyAllWindows(); return 0; }
#includevoid drawPlane() { glBegin(GL_QUADS); glVertex2f(-0.5, -0.5); glVertex2f(-0.5, 0.5); glVertex2f(0.5, 0.5); glVertex2f(0.5, -0.5); glEnd(); } void display() { glClear(GL_COLOR_BUFFER_BIT); glRotatef(0.1, 1.0, 1.0, 1.0); // rotate the Plane by 0.1 degrees around the (1, 1, 1) axis glMatrixMode(GL_MODELVIEW); glLoadIdentity(); drawPlane(); glutSwapBuffers(); } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize(800, 600); glutCreateWindow("Plane Rotation"); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1, 1, -1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glutDisplayFunc(display); glutIdleFunc(display); glutMainLoop(); return 0; }
#includeThis example shows how to create a Plane using FLTK. The `Fl_Window` class creates a window with a specified size. The `Fl_Box` class creates a box inside the window with the same size as the window. The `box` function sets the appearance of the box. The `window` function shows the window. The `Fl::run` function starts the event loop of the FLTK application.#include #include int main() { Fl_Window *window = new Fl_Window(800, 600); Fl_Box *box = new Fl_Box(0, 0, window->w(), window->h()); box->box(FL_FLAT_BOX); box->color(FL_WHITE); window->end(); window->show(); return Fl::run(); }