本文整理汇总了C++中MayaCamUI::getCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ MayaCamUI::getCamera方法的具体用法?C++ MayaCamUI::getCamera怎么用?C++ MayaCamUI::getCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MayaCamUI
的用法示例。
在下文中一共展示了MayaCamUI::getCamera方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void AssimpApp::draw()
{
gl::clear( Color::black() );
gl::setMatrices( mMayaCam.getCamera() );
gl::enableDepthWrite();
gl::enableDepthRead();
gl::color( Color::white() );
if ( mEnableWireframe )
gl::enableWireframe();
gl::Light light( gl::Light::DIRECTIONAL, 0 );
light.setAmbient( Color::white() );
light.setDiffuse( Color::white() );
light.setSpecular( Color::white() );
light.lookAt( Vec3f( 0, 5, -20 ), Vec3f( 0, 5, 0 ) );
light.update( mMayaCam.getCamera() );
light.enable();
gl::enable( GL_LIGHTING );
gl::enable( GL_NORMALIZE );
mAssimpLoader.draw();
gl::disable( GL_LIGHTING );
if ( mEnableWireframe )
gl::disableWireframe();
if ( mDrawBBox )
gl::drawStrokedCube( mAssimpLoader.getBoundingBox() );
params::InterfaceGl::draw();
}
示例2: mouseDrag
void StereoscopicRenderingApp::mouseDrag( MouseEvent event )
{
// handle camera
mMayaCam.mouseDrag( event.getPos(), event.isLeftDown(), event.isMiddleDown(), event.isRightDown() );
// update stereoscopic camera
mCamera.setEyePoint( mMayaCam.getCamera().getEyePoint() );
mCamera.setCenterOfInterestPoint( mMayaCam.getCamera().getCenterOfInterestPoint() );
}
示例3: draw
void cApp::draw(){
mExp.begin( camUi.getCamera() );{
gl::clear();
gl::enableAlphaBlending();
gl::pushMatrices();
if( !mExp.bRender && !mExp.bSnap ){
glLineWidth( 3 );
mt::drawCoordinate(100);
}
if( mDg.mDot ){
glPointSize( 1 );
gl::draw( mDg.mDot );
}
gl::popMatrices();
}mExp.end();
if( bDrawLine ){
mExp2.begin( camUi.getCamera() );{
gl::clear();
gl::enableAlphaBlending();
gl::pushMatrices();
if( mDg.mLine ){
glLineWidth( 1 );
gl::draw( mDg.mLine );
}
gl::popMatrices();
}mExp2.end();
}
//gl::enableAdditiveBlending();
gl::clear( ColorA(0,0,0,1) );
gl::color( Color::white() );
mExp.draw();
if( bDrawLine )
mExp2.draw();
gl::drawString("Frame: " + to_string(frame), Vec2f(50, 50) );
gl::drawString("simDirNum: " + to_string(simDirNum), Vec2f(50, 75) );
gl::drawString("numParticle: " + to_string(numParticle), Vec2f(50, 100) );
#ifdef RENDER
frame+=1;
#else
frame+=1;
#endif
}
示例4: computeAttractorPosition
void gpuPSApp::computeAttractorPosition()
{
// The attractor is positioned at the intersection of a ray
// from the mouse to a plane perpendicular to the camera.
float t = 0;
Vec3f right, up;
mMayaCam.getCamera().getBillboardVectors(&right, &up);
CameraPersp cam = mMayaCam.getCamera();
float u = mMousePos.x / (float) getWindowWidth();
float v = mMousePos.y / (float) getWindowHeight();
Ray ray = cam.generateRay(u , 1.0f - v, cam.getAspectRatio() );
if (ray.calcPlaneIntersection(Vec3f(0.0f,0.0f,0.0f), right.cross(up), &t)) {
mAttractor.set(ray.calcPosition(t));
}
}
示例5: resize
void FastTrailsApp::resize( ResizeEvent event )
{
// adjust aspect ratio
CameraPersp cam = mCamera.getCamera();
cam.setAspectRatio( event.getAspectRatio() );
mCamera.setCurrentCam( cam );
}
示例6: draw
void FastTrailsApp::draw()
{
// clear window
gl::clear();
// set render states
gl::enableWireframe();
gl::enableAlphaBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
// enable 3D camera
gl::pushMatrices();
gl::setMatrices( mCamera.getCamera() );
// draw VBO mesh using texture
mTexture.enableAndBind();
gl::drawRange( mVboMesh, 0, mTrail.size(), 0, mTrail.size()-1 );
mTexture.unbind();
// restore camera and render states
gl::popMatrices();
gl::disableDepthWrite();
gl::disableDepthRead();
gl::disableAlphaBlending();
gl::disableWireframe();
}
示例7: resize
void FadeCandyClientApp::resize()
{
// adjust aspect ratio
CameraPersp cam = mMayaCam.getCamera();
cam.setAspectRatio( getWindowAspectRatio() );
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: draw
void LookAroundYouApp::draw()
{
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
// set up the camera
gl::pushMatrices();
gl::setMatrices( mMayaCam.getCamera() );
for(int i=0; i<mBoids.size(); i++) {
mBoids[i]->draw();
}
gl::drawCoordinateFrame( 6.0f );
gl::popMatrices();
// Draw the interface
mParams.draw();
float pos = music->getPlayheadNorm();
Rectf bar(0, 0, app::getWindowWidth()*pos, 10);
gl::drawSolidRect(bar);
}
示例11: update
void PhysicallyBasedShadingApp::update()
{
// animate the light
if( mAnimateLight ){
mLightPosition = vec3( cos( mTime * 0.5f ) * 8.0f, 8.0f + sin( mTime * 0.25f ) * 3.5f, sin( mTime * 0.5f ) * 8.0f );
mTime += 0.025f;
}
// check for camera properties change
CameraPersp cam = mMayaCam.getCamera();
float sensorHeight = mSensorSize / getWindowAspectRatio();
float fov = 180.0f / M_PI * 2.0f * math<float>::atan( 0.5f * sensorHeight / mFocalLength );
if( mFocalLengthPreset != 0 && mFocalLengthPreset != mPrevFocalLengthPreset ){
mFocalLength = sFocalPresetsValues[ mFocalLengthPreset ];
}
if( mSensorSizePreset != 0 && mSensorSizePreset != mPrevSensorSizePreset ){
mSensorSize = sSensorPresetsValues[ mSensorSizePreset ];
}
if( mFStopPreset != 0 && mFStopPreset != mPrevFStopPreset ){
mFStop = sFStopPresetsValues[ mFStopPreset ];
}
mPrevFocalLengthPreset = mFocalLengthPreset;
mPrevSensorSizePreset = mSensorSizePreset;
mPrevFStopPreset = mFStopPreset;
// update the fov if necessary
if( cam.getFov() != fov ){
cam.setFov( fov );
mMayaCam.setCurrentCam( cam );
}
}
示例12: mouseDown
void MarionetteZooApp::mouseDown( MouseEvent event )
{
if ( mCameraLock )
mBulletWorld->mouseDown( event, mMayaCam.getCamera() );
else
mMayaCam.mouseDown( event.getPos() );
}
示例13: update
void ProceduralAnimApp::update()
{
mLightPos.x = mRotationRadius * math<float>::sin( float( app::getElapsedSeconds() ) );
mLightPos.z = mRotationRadius * math<float>::cos( float( app::getElapsedSeconds() ) );
mFlapAngle += 0.01f * mFlapIncrement;
float h = mAmplitude * 0.5f * math<float>::sin( mFlapAngle );
float t = mAmplitude * 0.5f * math<float>::sin( mFlapAngle - M_PI / 2 );
SkeletonRef skeleton = mSkinnedVboBird->getSkeleton();
NodeRef midL = skeleton->getBone("Gannet_Lwing_mid");
NodeRef midR = skeleton->getBone("Gannet_Rwing_mid");
NodeRef tipL = skeleton->getBone("Gannet_Lwing_tip");
NodeRef tipR = skeleton->getBone("Gannet_Rwing_tip");
midL->setRelativeRotation( midL->getInitialRelativeRotation() * Quatf( Vec3f::xAxis(), t ) * Quatf( Vec3f::zAxis(), mShoulderAngle ) );
midR->setRelativeRotation( midR->getInitialRelativeRotation() * Quatf( Vec3f::xAxis(), t ) * Quatf( Vec3f::zAxis(), mShoulderAngle ) );
tipL->setRelativeRotation( Quatf( Vec3f::yAxis(), h ) );
tipR->setRelativeRotation( Quatf( Vec3f::yAxis(), h ) );
NodeRef head = skeleton->getBone("Gannet_head");
head->setRelativeRotation( head->getInitialRelativeRotation().slerp(0.5f, mMayaCam.getCamera().getOrientation() ) );
skeleton->getBone("Gannet_body")->setRelativePosition( Vec3f(0, -t, 0) );
/* The mesh isn't automatically updated when the skeleton it contained is modified, so
* an update call is necessary (for now). This may change since I don't find it very
* intuitive... */
mSkinnedVboBird->update();
for( auto& d : mDust ) {
d.z -= 0.75f;
d.z = ( d.z < -SCENE_SIZE/2 ) ? SCENE_SIZE/2 : d.z;
}
}
示例14: resize
void HexagonMirrorApp::resize( ResizeEvent event )
{
// adjust the camera aspect ratio
CameraPersp cam = mCamera.getCamera();
cam.setAspectRatio( event.getAspectRatio() );
mCamera.setCurrentCam( cam );
}
示例15: draw
void rayMarcherApp::draw()
{
glClearColor( 0, 0, 0, 0 );
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glEnable( GL_DEPTH_TEST );
glEnable( GL_LIGHTING );
glDepthMask( GL_TRUE );
glDisable( GL_TEXTURE_2D );
gl::setMatrices( mMayaCam.getCamera() );
mMarcher.renderSceneGL();
gl::setMatricesWindow( getWindowSize() );
// draw as much of the texture as we've rendered
glDisable( GL_LIGHTING );
glDepthMask( GL_TRUE );
glDisable( GL_DEPTH_TEST );
glColor3f( 1, 1, 1 );
mImageTexture.enableAndBind();
glBegin( GL_QUADS );
glTexCoord2f( mImageTexture.getLeft(), mImageTexture.getTop() );
glVertex2f( 0, 0 );
glTexCoord2f( mImageTexture.getLeft(), mImageTexture.getBottom() * mCurrentLine / mImageTexture.getHeight() );
glVertex2f( 0, mCurrentLine );
glTexCoord2f( mImageTexture.getRight(), mImageTexture.getBottom() * mCurrentLine / mImageTexture.getHeight() );
glVertex2f( mImageTexture.getWidth(), mCurrentLine );
glTexCoord2f( mImageTexture.getRight(), mImageTexture.getTop() );
glVertex2f( mImageTexture.getWidth(), 0 );
glEnd();
}