voidWidget::keyPressEvent(QKeyEvent *event){ // A 左旋 // D 右旋 // W 放大 // S 缩小 switch (event->key()) { case Qt::Key_A: rotate(-3); break; case Qt::Key_D: rotate(3); break; case Qt::Key_W: scale(1.1, 1.1); break; case Qt::Key_S: scale(1/1.1, 1/1.1); break; }
In computer science, binary space partitioning (BSP) is a method for recursively subdividing a space into convex sets by hyperplanes. This subdivision gives rise to a representation of objects within the space by means of a tree data structure known as a BSP tree.
Binary space partitioning was developed in the context of 3D computer graphics,[1][2] where the structure of a BSP tree allows spatial information about the objects in a scene that is useful in rendering, such as their ordering from front-to-back with respect to a viewer at a given location, to be accessed rapidly. Other applications include performing geometrical operations with shapes (constructive solid geometry) in CAD,[3] collision detection in robotics and 3-D video games, ray tracing and other computer applications that involve handling of complex spatial scenes.