本文整理汇总了C++中osg::Trackball::setStartRotation方法的典型用法代码示例。如果您正苦于以下问题:C++ Trackball::setStartRotation方法的具体用法?C++ Trackball::setStartRotation怎么用?C++ Trackball::setStartRotation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::Trackball
的用法示例。
在下文中一共展示了Trackball::setStartRotation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: key
void key(unsigned char key, int x, int y)
{
switch ( key )
{
case 27:
fprintf(stderr, "Start Destruction\n\n");
rentravact = NULL;
hdrroot = NULL;
root = NULL;
file = NULL;
cam = NULL;
vp = NULL;
win = NULL;
cam_trans = NULL;
scene_trans = NULL;
pAnimTrs[0] = NULL;
pAnimTrs[1] = NULL;
pAnimTrs[2] = NULL;
pAnimTrs[3] = NULL;
pAnimTrs[4] = NULL;
pAnimTrs[5] = NULL;
OSG::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 'r':
{
std::cerr << "Sending ray through " << x << "," << y << std::endl;
OSG::Line l;
cam->calcViewRay( l, x, y, *vp );
std::cerr << "From " << l.getPosition() << ", dir "
<< l.getDirection()
<< std::endl;
}
break;
case 'd':
OSG::ActionDataSlotPool::the()->dumpState();
OSG::StageIdPool ::the()->dumpState();
rentravact->dumpStore();
break;
case ' ':
{
OSG::Matrix m;
OSG::Quaternion q;
OSG::Vec3f v;
q = oldq;
v = oldv;
oldq = tball.getRotation();
oldv = tball.getPosition();
move_obj = ! move_obj;
if ( move_obj )
{
puts("moving object");
tball.setMode( OSG::Trackball::OSGCamera );
}
else
{
puts("moving camera");
tball.setMode( OSG::Trackball::OSGObject );
}
tball.setStartPosition( v, true );
tball.setStartRotation( q, true );
}
break;
}
}
示例2: key
//.........这里部分代码省略.........
pFBO_RB->setSize(uiImgSize, uiImgSize);
pFBO_RB->setColorAttachment(pRenBuffer, 0);
pFBO_RB->setDepthAttachment(pDepthBuffer_RB );
pFBO_RB->editMFDrawBuffers()->clear();
pFBO_RB->editMFDrawBuffers()->push_back(GL_COLOR_ATTACHMENT0_EXT);
vpFBO_RB->setFrameBufferObject(pFBO_RB);
pRenBuffer ->setReadBack (true);
vpFBO_RB->getFrameBufferObject()->setPostProcessOnDeactivate(true);
win->addPort(vpFBO_RB);
dumpImg_RB = true;
}
break;
case 'v':
rentravact->setVolumeDrawing(!rentravact->getVolumeDrawing());
break;
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':
pPoly->setFrontMode(GL_POINT);
pPoly->setBackMode(GL_POINT);
std::cerr << "PolygonMode: Point." << std::endl;
break;
case 'x':
pPoly->setFrontMode(GL_LINE);
pPoly->setBackMode(GL_LINE);
std::cerr << "PolygonMode: Line." << std::endl;
break;
case 'c':
pPoly->setFrontMode(GL_FILL);
pPoly->setBackMode(GL_FILL);
std::cerr << "PolygonMode: Fill." << std::endl;
break;
case 'p':
{
if(bPolyActive == true)
{
OSG_ASSERT(pCOver->subChunk(pPoly) == true);
bPolyActive = false;
}
else
{
OSG_ASSERT(pCOver->addChunk(pPoly) == true);
bPolyActive = true;
}
break;
}
case ' ':
{
OSG::Matrix m;
OSG::Quaternion q;
OSG::Vec3f v;
q = oldq;
v = oldv;
oldq = tball.getRotation();
oldv = tball.getPosition();
move_obj = ! move_obj;
if ( move_obj )
{
puts("moving object");
// m = scene_trans->getSFMatrix()->getValue();
tball.setMode( OSG::Trackball::OSGCamera );
}
else
{
puts("moving camera");
// m = cam_trans->getSFMatrix()->getValue();
tball.setMode( OSG::Trackball::OSGObject );
}
// q.setValue(m);
tball.setStartPosition( v, true );
tball.setStartRotation( q, true );
// std::cout << q << std::endl;
// std::cout << v << std::endl;
// std::cout << " " << m[3][0] << " " << m[3][1] << " " << m[3][2] << std::endl;
}
break;
}
}
示例3: key
void key(unsigned char key, int x, int y)
{
switch ( key )
{
case 27:
fprintf(stderr, "Start Destruction\n\n");
rentravact = NULL;
hdrroot = NULL;
root = NULL;
// file = NULL;
cam = NULL;
vp = NULL;
win = NULL;
cam_trans = NULL;
scene_trans = NULL;
pAnimTrs[0] = NULL;
pAnimTrs[1] = NULL;
pAnimTrs[2] = NULL;
pAnimTrs[3] = NULL;
pAnimTrs[4] = NULL;
pAnimTrs[5] = NULL;
OSG::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 'r':
{
std::cerr << "Sending ray through " << x << "," << y << std::endl;
OSG::Line l;
cam->calcViewRay( l, x, y, *vp );
std::cerr << "From " << l.getPosition() << ", dir "
<< l.getDirection()
<< std::endl;
}
break;
case 'g':
hdrroot->setCore(OSG::Group::create());
break;
case 'h':
createHDRCore(hdrroot);
break;
case 'd':
OSG::ActionDataSlotPool::the()->dumpState();
OSG::StageIdPool ::the()->dumpState();
rentravact->dumpStore();
break;
case ' ':
{
OSG::Matrix m;
OSG::Quaternion q;
OSG::Vec3f v;
q = oldq;
v = oldv;
oldq = tball.getRotation();
oldv = tball.getPosition();
move_obj = ! move_obj;
if ( move_obj )
{
puts("moving object");
tball.setMode( OSG::Trackball::OSGCamera );
}
else
{
puts("moving camera");
tball.setMode( OSG::Trackball::OSGObject );
}
tball.setStartPosition( v, true );
tball.setStartRotation( q, true );
}
break;
case '1':
{
OSG::HDR2Stage* pHDR = dynamic_cast<OSG::HDR2Stage*>(hdrroot->getCore());
if (pHDR) pHDR->setTarget(OSG::HDR2Stage::SCENE_TEXTURE);
}
break;
case '2':
{
OSG::HDR2Stage* pHDR = dynamic_cast<OSG::HDR2Stage*>(hdrroot->getCore());
//.........这里部分代码省略.........