本文整理汇总了C++中BoundingBox::computeAxisAlignedBox方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::computeAxisAlignedBox方法的具体用法?C++ BoundingBox::computeAxisAlignedBox怎么用?C++ BoundingBox::computeAxisAlignedBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::computeAxisAlignedBox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyboard
void keyboard(unsigned char key, int x0, int y0)
{
switch (key) {
case 27 :
exit(0);
case ' ':
static int i = 0;
i++;
if (i == 2) i = 0;
mesh.read(paths[i]);
if (drawAABB) boundingBox.computeAxisAlignedBox(mesh.vertices);
else boundingBox.computeOrientedBox(mesh.vertices);
break;
case 'b':
drawAABB = !drawAABB;
if (drawAABB) {
boundingBox.computeAxisAlignedBox(mesh.vertices);
glutSetWindowTitle("Bounding Box - Axis Aligned");
} else {
boundingBox.computeOrientedBox(mesh.vertices);
glutSetWindowTitle("Bounding Box - Oriented");
}
break;
case 'a':
x -= 0.03;
break;
case 'd':
x += 0.03;
break;
case 'w':
y += 0.03;
break;
case 's':
y -= 0.03;
break;
}
glutPostRedisplay();
}
示例2: main
int main(int argc, char** argv) {
success = mesh.read(paths[0]);
if (success) boundingBox.computeAxisAlignedBox(mesh.vertices);
printInstructions();
glutInitWindowSize(gridX, gridY);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInit(&argc, argv);
glutCreateWindow("Bounding Box - Axis Aligned");
init();
glutDisplayFunc(display);
glutKeyboardFunc(keyboard);
glutSpecialFunc(special);
glutMainLoop();
return 0;
}