本文整理汇总了C++中PerspectiveCameraPtr::calcViewRay方法的典型用法代码示例。如果您正苦于以下问题:C++ PerspectiveCameraPtr::calcViewRay方法的具体用法?C++ PerspectiveCameraPtr::calcViewRay怎么用?C++ PerspectiveCameraPtr::calcViewRay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PerspectiveCameraPtr
的用法示例。
在下文中一共展示了PerspectiveCameraPtr::calcViewRay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: key
void key(unsigned char key, int x, int y)
{
switch ( key )
{
case 27: osgExit(); exit(0);
case 'a': glDisable( GL_LIGHTING );
std::cerr << "Lighting disabled." << std::endl;
break;
case 's': glEnable( GL_LIGHTING );
std::cerr << "Lighting enabled." << std::endl;
break;
case 'z': glPolygonMode( GL_FRONT_AND_BACK, GL_POINT);
std::cerr << "PolygonMode: Point." << std::endl;
break;
case 'x': glPolygonMode( GL_FRONT_AND_BACK, GL_LINE);
std::cerr << "PolygonMode: Line." << std::endl;
break;
case 'c': glPolygonMode( GL_FRONT_AND_BACK, GL_FILL);
std::cerr << "PolygonMode: Fill." << std::endl;
break;
case 'r':
{
std::cerr << "Sending ray through " << x << "," << y << std::endl;
Line l;
cam->calcViewRay( l, x, y, *vp );
std::cerr << "From " << l.getPosition() << ", dir "
<< l.getDirection() << std::endl;
}
break;
case 'S': std::cerr << "Saving Image" << std::endl;
image->write("test.ppm");
break;
}
}