本文整理汇总了C++中MayaCamUI::setCurrentCam方法的典型用法代码示例。如果您正苦于以下问题:C++ MayaCamUI::setCurrentCam方法的具体用法?C++ MayaCamUI::setCurrentCam怎么用?C++ MayaCamUI::setCurrentCam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MayaCamUI
的用法示例。
在下文中一共展示了MayaCamUI::setCurrentCam方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void MarionetteZooApp::update()
{
mFps = getAverageFps();
CameraPersp cam = mMayaCam.getCamera();
if ( cam.getFov() != mCameraFov )
{
cam.setPerspective( mCameraFov, getWindowAspectRatio(), 0.1f, 1000.0f );
mMayaCam.setCurrentCam( cam );
}
if( mCameraLock )
{
if( mCameraEyePoint != cam.getEyePoint() )
{
cam.setEyePoint( mCameraEyePoint );
mMayaCam.setCurrentCam( cam );
}
if( mCameraCenterOfInterestPoint != cam.getCenterOfInterestPoint() )
{
cam.setCenterOfInterestPoint( mCameraCenterOfInterestPoint );
mMayaCam.setCurrentCam( cam );
}
}
else
{
mCameraEyePoint = cam.getEyePoint();
mCameraCenterOfInterestPoint = cam.getCenterOfInterestPoint();
}
// mLight->setDirection( mLightDirection * Vec3f( 1.f, 1.f, -1.f ) );
// mLight->update( cam );
mBulletWorld->update();
mModelManager->update();
}
示例2: keyDown
void cApp::keyDown( KeyEvent event ){
switch (event.getChar()) {
case '1': camUi.setCurrentCam(cams[0]); break;
case '2': camUi.setCurrentCam(cams[1]); break;
case '3': camUi.setCurrentCam(cams[2]); break;
case '4': camUi.setCurrentCam(cams[3]); break;
case '5': camUi.setCurrentCam(cams[4]); break;
case 'R': mExp.startRender(); break;
case 'T': mExp.stopRender(); break;
case 'f': frame+=100; break;
case '0': frame=0; simDirNum++; break;
}
}
示例3: setup
void AssimpApp::setup()
{
mAssimpLoader = assimp::AssimpLoader( getAssetPath( "astroboy_walk.dae" ) );
mAssimpLoader.setAnimation( 0 );
CameraPersp cam;
cam.setPerspective( 60, getWindowAspectRatio(), 0.1f, 1000.0f );
cam.setEyePoint( Vec3f( 0, 7, 20 ) );
cam.setCenterOfInterestPoint( Vec3f( 0, 7, 0 ) );
mMayaCam.setCurrentCam( cam );
mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 300 ) );
mEnableWireframe = false;
mParams.addParam( "Wireframe", &mEnableWireframe );
mEnableTextures = true;
mParams.addParam( "Textures", &mEnableTextures );
mEnableSkinning = true;
mParams.addParam( "Skinning", &mEnableSkinning );
mEnableAnimation = false;
mParams.addParam( "Animation", &mEnableAnimation );
mDrawBBox = false;
mParams.addParam( "Bounding box", &mDrawBBox );
mParams.addSeparator();
mParams.addParam( "Fps", &mFps, "", true );
}
示例4: resize
void reflection_animationApp::resize( ResizeEvent event )
{
// reset camera on resize
CameraPersp cam = m_mayaCam.getCamera();
cam.setAspectRatio( getWindowAspectRatio() );
m_mayaCam.setCurrentCam( cam );
}
示例5: setup
void FadeCandyClientApp::setup()
{
bInitialized = false;
g_Width = 124; // set global width and height to something
g_Height = 8; // they need to be reset when the receiver connects to a sender
//point FC to host and port
effectRunner = FCEffectRunner::create("127.0.0.1",7890);
//create instance of our custom effect
e = MyEffect::create(spoutSurf);
effectRunner->setEffect(boost::dynamic_pointer_cast<FCEffect>( e ));
effectRunner->setMaxFrameRate(400);
effectRunner->setVerbose(true);
effectRunner->setLayout("layouts/grid16x8.json",0);
//add visualizer to see effect on screen
FCEffectVisualizerRef viz = FCEffectVisualizer::create();
effectRunner->setVisualizer(viz);
// set up the camera
CameraPersp cam;
cam.setEyePoint( Vec3f(300.0f, 250.f, -500.0f) );
cam.setCenterOfInterestPoint( Vec3f(300.0f, 200.0f, 0.0f) );
cam.setPerspective( 60.0f, getWindowAspectRatio(), 1.0f, 1000.0f );
mMayaCam.setCurrentCam( cam );
gl::disableVerticalSync();
}
示例6: resize
void FadeCandyClientApp::resize()
{
// adjust aspect ratio
CameraPersp cam = mMayaCam.getCamera();
cam.setAspectRatio( getWindowAspectRatio() );
mMayaCam.setCurrentCam( cam );
}
示例7: setup
void TessellationSampleApp::setup()
{
// setup shader
// try {
// mGlsl = gl::GlslProg::create( gl::GlslProg::Format().vertex( loadAsset( "basic.vert" ) )
// .fragment( loadAsset( "basic.frag" ) )
// .geometry( loadAsset( "basic.geom" ) ) );
// }
// catch( gl::GlslProgCompileExc ex ) {
// cout << ex.what() << endl;
// shutdown();
// }
// setup VertBatch with a single point at the origin
// mBatch = gl::VertBatch::create();
// mBatch->vertex( Vec2f::zero() );
// mBatch->color( 1.0f, 0.0f, 0.0f );
vertexArrayObject = gl::Vao::create();
vertexBufferObject = gl::Vbo::create(GL_ARRAY_BUFFER);
indexBufferObject = gl::Vbo::create(GL_ELEMENT_ARRAY_BUFFER);
mTessellationInner = mTessellationOuter = 3;
this->loadShader();
this->createIcosahedron();
CameraPersp cam;
cam.setEyePoint( Vec3f(5.0f, 10.0f, 10.0f) );
cam.setCenterOfInterestPoint( Vec3f(0.0f, 2.5f, 0.0f) );
cam.setPerspective( 60.0f, getWindowAspectRatio(), 1.0f, 1000.0f );
mMayaCam.setCurrentCam( cam );
}
示例8: resize
void TessellationSampleApp::resize()
{
// adjust aspect ratio
CameraPersp cam = mMayaCam.getCamera();
cam.setAspectRatio( getWindowAspectRatio() );
mMayaCam.setCurrentCam( cam );
}
示例9: frameCurrentObject
void wellingtonModelApp::frameCurrentObject()
{
Sphere boundingSphere = Sphere::calculateBoundingSphere( mMesh.getVertices() );
mMayaCam.setCurrentCam( mMayaCam.getCamera().getFrameSphere( boundingSphere, 100 ) );
}
示例10: setup
void cApp::setup(){
int w = win_w*master_scale;
int h = win_h*master_scale;
setFrameRate( fps );
setWindowSize( w*0.5, h*0.5 );
setWindowPos( 0, 0 );
mExp.setup( w, h, 0, 3000, GL_RGB, mt::getRenderPath(), 0);
CameraPersp cam( w, h, 54.4f, 1, 10000 );
cam.lookAt( Vec3f(0,0, 1300), Vec3f(0,0,0) );
cam.setCenterOfInterestPoint( Vec3f(0,0,0) );
camUi.setCurrentCam( cam );
assetDir = mt::getAssetPath();
simDir.push_back( assetDir/"sim"/"red_particle3"/"rpc2");
int nSim = simDir.size();
vbo.assign( nSim, VboSet() );
#ifdef RENDER
mExp.startRender();
#endif
}
示例11: resize
void FastTrailsApp::resize( ResizeEvent event )
{
// adjust aspect ratio
CameraPersp cam = mCamera.getCamera();
cam.setAspectRatio( event.getAspectRatio() );
mCamera.setCurrentCam( cam );
}
示例12: setup
void MarionetteZooApp::setup()
{
gl::enableDepthRead();
gl::enableDepthWrite();
setupParams();
CameraPersp cam;
cam.setPerspective( mCameraFov, getWindowAspectRatio(), 0.1f, 1000.0f );
cam.setEyePoint( mCameraEyePoint );
cam.setCenterOfInterestPoint( mCameraCenterOfInterestPoint );
mMayaCam.setCurrentCam( cam );
{
// glEnable( GL_LIGHTING );
// glEnable( GL_DEPTH_TEST );
// glEnable( GL_RESCALE_NORMAL );
//
// //create light
// mLight = new gl::Light( gl::Light::DIRECTIONAL, 0 );
// mLight->setAmbient( Color( 1.0f, 1.0f, 1.0f ) );
// mLight->setDiffuse( Color( 1.0f, 1.0f, 1.0f ) );
// mLight->setSpecular( Color( 1.0f, 1.0f, 1.0f ) );
// mLight->setShadowParams( 100.0f, 1.0f, 20.0f );
// // mLight->update( cam );
// // mLight->enable();
}
mBulletWorld = BulletWorldRef( new BulletWorld() );
mBulletWorld->setup();
mModelManager = ModelManagerRef( new ModelManager( mBulletWorld ) );
}
示例13: resize
void HexagonMirrorApp::resize( ResizeEvent event )
{
// adjust the camera aspect ratio
CameraPersp cam = mCamera.getCamera();
cam.setAspectRatio( event.getAspectRatio() );
mCamera.setCurrentCam( cam );
}
示例14: resize
void HexagonMirrorApp::resize()
{
// adjust the camera aspect ratio
CameraPersp cam = mCamera.getCamera();
cam.setAspectRatio( getWindowAspectRatio() );
mCamera.setCurrentCam( cam );
}
示例15: setup
void HexagonMirrorApp::setup()
{
// initialize camera
CameraPersp cam;
cam.setEyePoint( Vec3f(44, 34, 57) );
cam.setCenterOfInterestPoint( Vec3f(44, 34, 0) );
cam.setFov( 60.0f );
mCamera.setCurrentCam( cam );
// load shader
try {
mShaderInstanced = gl::GlslProg( loadAsset("phong_vert.glsl"), loadAsset("phong_frag.glsl") );
}
catch( const std::exception &e ) {
console() << e.what() << std::endl;
}
// create a vertex array object, which allows us to efficiently position each instance
initializeBuffer();
// load hexagon mesh
loadMesh();
// connect to a webcam
mWebcam = Capture( 160, 120 );
}