当前位置: 首页>>代码示例>>C++>>正文


C++ MayaCamUI::getCamera方法代码示例

本文整理汇总了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();
}
开发者ID:Dewb,项目名称:Cinder-Assimp,代码行数:35,代码来源:AssimpApp.cpp

示例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() );
}
开发者ID:AKS2346,项目名称:Cinder,代码行数:9,代码来源:StereoscopicRenderingApp.cpp

示例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

}
开发者ID:stdmtb,项目名称:n9,代码行数:51,代码来源:cApp.cpp

示例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));
    }
}
开发者ID:jacquemin,项目名称:Cinder-Particles,代码行数:15,代码来源:gpuPSApp.cpp

示例5: resize

void FastTrailsApp::resize( ResizeEvent event )
{
	// adjust aspect ratio
	CameraPersp cam = mCamera.getCamera();
	cam.setAspectRatio( event.getAspectRatio() );
	mCamera.setCurrentCam( cam );
}
开发者ID:audionerd,项目名称:Cinder-Samples,代码行数:7,代码来源:FastTrailsApp.cpp

示例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();
}
开发者ID:audionerd,项目名称:Cinder-Samples,代码行数:30,代码来源:FastTrailsApp.cpp

示例7: resize

void FadeCandyClientApp::resize()
{
	// adjust aspect ratio
	CameraPersp cam = mMayaCam.getCamera();
	cam.setAspectRatio( getWindowAspectRatio() );
	mMayaCam.setCurrentCam( cam );
}
开发者ID:initialfx,项目名称:TDFadeCandy,代码行数:7,代码来源:FadeCandyClientApp.cpp

示例8: resize

void TessellationSampleApp::resize()
{
	// adjust aspect ratio
	CameraPersp cam = mMayaCam.getCamera();
	cam.setAspectRatio( getWindowAspectRatio() );
	mMayaCam.setCurrentCam( cam );
}
开发者ID:calebjohnston,项目名称:Cinder-Tessellation,代码行数:7,代码来源:TessellationSampleApp.cpp

示例9: frameCurrentObject

void wellingtonModelApp::frameCurrentObject()
{
    Sphere boundingSphere = Sphere::calculateBoundingSphere( mMesh.getVertices() );
	
	mMayaCam.setCurrentCam( mMayaCam.getCamera().getFrameSphere( boundingSphere, 100 ) );
    
}
开发者ID:chalmersgit,项目名称:wellingtonModel_withWater,代码行数:7,代码来源:wellingtonModelApp.cpp

示例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);
}
开发者ID:KitchenTableCoders,项目名称:3daudio,代码行数:25,代码来源:LookAroundYouApp.cpp

示例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 );
	}
}
开发者ID:WARP-LAB,项目名称:Cinder-Experiments,代码行数:32,代码来源:PhysicallyBasedShadingApp.cpp

示例12: mouseDown

void MarionetteZooApp::mouseDown( MouseEvent event )
{
	if ( mCameraLock )
		mBulletWorld->mouseDown( event, mMayaCam.getCamera() );
	else
		mMayaCam.mouseDown( event.getPos() );
}
开发者ID:bgbotond,项目名称:MarionetteZoo,代码行数:7,代码来源:MarionetteZooApp.cpp

示例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;
	}
}
开发者ID:QiangJi,项目名称:Cinder-Skinning,代码行数:34,代码来源:ProceduralAnimApp.cpp

示例14: resize

void HexagonMirrorApp::resize( ResizeEvent event )
{
    // adjust the camera aspect ratio
    CameraPersp cam = mCamera.getCamera();
    cam.setAspectRatio( event.getAspectRatio() );
    mCamera.setCurrentCam( cam );
}
开发者ID:audionerd,项目名称:Cinder-Samples,代码行数:7,代码来源:HexagonMirrorApp.cpp

示例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();
}
开发者ID:rkabir,项目名称:Cinder,代码行数:33,代码来源:rayMarcherApp.cpp


注:本文中的MayaCamUI::getCamera方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。