本文整理汇总了C++中MayaCamUI类的典型用法代码示例。如果您正苦于以下问题:C++ MayaCamUI类的具体用法?C++ MayaCamUI怎么用?C++ MayaCamUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MayaCamUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
void rayMarcherApp::setup()
{
CameraPersp cam;
mStartEyePoint = Vec3f( 15, 21, 27.5 ) * 0.65f;
cam.lookAt( mStartEyePoint, Vec3f::zero(), Vec3f::yAxis() );
cam.setCenterOfInterest( mStartEyePoint.distance( Vec3f::zero() ) );
mMayaCam.setCurrentCam( cam );
}
示例2: mouseDrag
void FadeCandyClientApp::mouseDrag( MouseEvent event )
{
// keep track of the mouse
mMousePos = event.getPos();
// let the camera handle the interaction
mMayaCam.mouseDrag( event.getPos(), event.isLeftDown(), event.isMiddleDown(), event.isRightDown() );
}
示例3: mouseDrag
void LookAroundYouApp::mouseDrag( MouseEvent event )
{
mMousePos = event.getPos();
// Added/hacked support for international mac laptop keyboards.
bool middle = event.isMiddleDown() || ( event.isMetaDown() && event.isLeftDown() );
bool right = event.isRightDown() || ( event.isControlDown() && event.isLeftDown() );
mMayaCam.mouseDrag( event.getPos(), event.isLeftDown() && !middle && !right, middle, right );
}
示例4: resize
void StereoscopicRenderingApp::resize()
{
// make sure the camera's aspect ratio remains correct
mCamera.setAspectRatio( getWindowAspectRatio() );
mMayaCam.setCurrentCam( mCamera );
// create/resize the Frame Buffer Object required for some of the render methods
createFbo();
}
示例5: mouseDown
void wellingtonModelApp::mouseDown( MouseEvent event )
{
// /*
if( event.isAltDown() )
mMayaCam.mouseDown( event.getPos() );
else
mArcball.mouseDown( event.getPos() );
// */
}
示例6: draw
void CameraLensShiftTestApp::draw()
{
gl::clear();
gl::enableDepthRead();
gl::enableDepthWrite();
// draw the overview of the scene in the left half of the window
glPushAttrib( GL_VIEWPORT_BIT );
gl::setViewport( Area( getWindowWidth() * 0.0f, 0, getWindowWidth() * 0.5f, getWindowHeight() ) );
gl::pushMatrices();
gl::setMatrices( mOverview.getCamera() );
render();
gl::color( Color(0, 1, 1) );
gl::drawFrustum( mCamera );
gl::popMatrices();
glPopAttrib();
// draw what the camera sees in the right half of the window
glPushAttrib( GL_VIEWPORT_BIT );
gl::setViewport( Area( getWindowWidth() * 0.5f, 0, getWindowWidth() * 1.0f, getWindowHeight() ) );
gl::pushMatrices();
gl::setMatrices( mCamera );
render();
gl::popMatrices();
glPopAttrib();
//
gl::disableDepthWrite();
gl::disableDepthRead();
// draw separator
gl::color( Color(0.25f, 0.25f, 0.25f) );
gl::drawLine( Vec2f( getWindowWidth() * 0.5f, 0.0f ), Vec2f( getWindowWidth() * 0.5f, getWindowHeight() ) );
// draw info
gl::enableAlphaBlending();
gl::drawString(
(boost::format("Lens Shift X: %02.2f\nLens Shift Y: %02.2f\n\nUse cursor keys to adjust lens shift,\nuse mouse to control overview camera")
% mCamera.getLensShiftHorizontal() % mCamera.getLensShiftVertical() ).str(),
Vec2f( 10, 10 ), Color::white(), mFont );
gl::drawString( "Overview of the scene",
Vec2f( 10, getWindowHeight() - 28 ), Color::white(), mFont );
gl::drawString( "View from the camera",
Vec2f( 0.5f * getWindowWidth() + 10, getWindowHeight() - 28 ), Color::white(), mFont );
gl::disableAlphaBlending();
}
示例7: draw
void HexagonMirrorApp::draw()
{
// clear the window
gl::clear();
// activate our camera
gl::pushMatrices();
gl::setMatrices( mCamera.getCamera() );
// set render states
gl::enable( GL_CULL_FACE );
gl::enableDepthRead();
gl::enableDepthWrite();
gl::color( Color::white() );
if( mVboMesh && mShaderInstanced && mBuffer )
{
// bind webcam image
if( mWebcamTexture )
mWebcamTexture.bind(0);
// bind the shader, which will do all the hard work for us
mShaderInstanced.bind();
mShaderInstanced.uniform( "texture", 0 );
mShaderInstanced.uniform( "scale", Vec2f( 1.0f / (3.0f * INSTANCES_PER_ROW), 1.0f / (3.0f * INSTANCES_PER_ROW) ) );
// bind the buffer containing the model matrix for each instance,
// this will allow us to pass this information as a vertex shader attribute.
// See: initializeBuffer()
glBindVertexArray(mVAO);
// we do all positioning in the shader, and therefor we only need
// a single draw call to render all instances.
drawInstanced( mVboMesh, NUM_INSTANCES );
// make sure our VBO is no longer bound
mVboMesh.unbindBuffers();
// unbind vertex array object containing our buffer
glBindVertexArray(0);
// unbind shader
mShaderInstanced.unbind();
if( mWebcamTexture )
mWebcamTexture.unbind();
}
// reset render states
gl::disableDepthWrite();
gl::disableDepthRead();
gl::disable( GL_CULL_FACE );
// restore 2D drawing
gl::popMatrices();
}
示例8: draw
void AudioObjApp::draw()
{
gl::clear( Color( 0, 0, 0 ) );
gl::enableAlphaBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
gl::pushMatrices();
gl::setMatrices( mMayaCam.getCamera() );
if ( mFeature && mFeatureTex )
{
mShader->bind();
mFeatureTex.enableAndBind();
mShader->uniform( "dataTex", 0 );
mShader->uniform( "texWidth", (float)mFeatureTex.getWidth() );
mShader->uniform( "texHeight", (float)mFeatureTex.getHeight() );
mShader->uniform( "soundDataSize", (float)mFeature->getSize() );
mShader->uniform( "spread", mFeatureSpread );
mShader->uniform( "spreadOffset", mFeatureSpreadOffset );
mShader->uniform( "time", (float)getElapsedSeconds() );
mShader->uniform( "tintColor", mObjColor );
}
if ( mRenderWireframe )
gl::enableWireframe();
gl::color( Color(1.0f, 0.0f, 0.0f ) );
if ( mVbo )
gl::draw( mVbo );
if ( mRenderWireframe )
gl::disableWireframe();
mShader->unbind();
mFeatureTex.unbind();
gl::color( Color::white() );
// gl::drawCoordinateFrame();
gl::popMatrices();
gl::disableDepthRead();
gl::disableDepthWrite();
gl::setMatricesWindow( getWindowSize() );
ciXtractReceiver::drawData( mFeature, Rectf( 15, getWindowHeight() - 150, 255, getWindowHeight() - 35 ) );
gl::draw( mFeatureSurf );
mParams->draw();
}
示例9: draw
void MarionetteZooApp::draw()
{
// clear out the window with black
gl::clear( Colorf( 0.392, 0.392, 0.784 ) );
gl::setViewport( getWindowBounds() );
gl::setMatrices( mMayaCam.getCamera() );
gl::enableDepthRead();
gl::enableDepthWrite();
ci::gl::pushMatrices();
mBulletWorld->draw();
ci::gl::popMatrices();
mModelManager->draw( mMayaCam.getCamera() );
ci::gl::drawCoordinateFrame( 5.f );
mParams.draw();
}
示例10: mouseDrag
void wellingtonModelApp::mouseDrag(MouseEvent event)
{
// /*
mouseMove(event);
if( event.isAltDown() )
mMayaCam.mouseDrag( event.getPos(), event.isLeftDown(), event.isMiddleDown(), event.isRightDown() );
else
mArcball.mouseDrag( event.getPos() );
// */
}
示例11: disableWireframe
void HiKinectApp::draw3D() {
gl::setMatrices( mCamUI.getCamera() );
if (mWireframe) gl::enableWireframe();
else gl::disableWireframe();
if (mLighting) {
glEnable( GL_LIGHTING );
glEnable( GL_LIGHT0 );
}
// GLfloat light_position[] = { mMousePos.x, mMousePos.y, -275.0f, 0.0f };
GLfloat light_position[] = { 0, 0, 1.0f, 0.0f };
glLightfv( GL_LIGHT0, GL_POSITION, light_position );
if( DIFFUSE ){
ci::ColorA color( CM_RGB, 1.0f, 1.0f, 1.0f, 1.0f );
glMaterialfv( GL_FRONT, GL_DIFFUSE, color );
} else {
glMaterialfv( GL_FRONT, GL_DIFFUSE, no_mat );
}
if( AMBIENT )
glMaterialfv( GL_FRONT, GL_AMBIENT, mat_ambient );
else
glMaterialfv( GL_FRONT, GL_AMBIENT, no_mat );
if( SPECULAR ){
glMaterialfv( GL_FRONT, GL_SPECULAR, mat_specular );
glMaterialfv( GL_FRONT, GL_SHININESS, mat_shininess );
} else {
glMaterialfv( GL_FRONT, GL_SPECULAR, no_mat );
glMaterialfv( GL_FRONT, GL_SHININESS, no_shininess );
}
if( EMISSIVE )
glMaterialfv( GL_FRONT, GL_EMISSION, mat_emission );
else
glMaterialfv( GL_FRONT, GL_EMISSION, no_mat );
if (mDepthTexture)
mDepthTexture.bind(0);
mFbo.bindTexture(1);
if (mColorTexture)
mColorTexture.bind(2);
mGridMesh.draw( lmap(mMousePos.x, 0.0f, (float)getWindowWidth(), 0.0f, 1.0f) );
if (mLighting) {
glDisable( GL_LIGHTING );
glDisable( GL_LIGHT0 );
}
gl::disableWireframe();
}
示例12: setup
void GizmoSampleApp::setup()
{
// Create a reference to our gizmo object
mGizmo = Gizmo::create( getWindowSize() );
// Create the cam interface
CameraPersp cam;
cam.setEyePoint( Vec3f( 0.0f, 300.0f, 500.0f ) );
cam.setPerspective(50, getWindowWidth() / (float) getWindowHeight(), 1, 10000 );
cam.setCenterOfInterestPoint( Vec3f::zero() );
mCamUI.setCurrentCam( cam );
}
示例13: draw
void godComplexApp::draw()
{
gl::enableDepthRead();
gl::enableDepthWrite();
gl::enableAlphaBlending();
// clear out the window with black
gl::clear( Color( 0, 0, 0 ) );
gl::setMatrices( mMayaCam.getCamera());
if(drawWater == true){
if(mWaterModule != NULL){
gl::pushMatrices();
mWaterModule->draw(0);
gl::popMatrices();
}
}
if(drawMesh == true){
gl::pushMatrices();
myImage.enableAndBind();
// gl::rotate( mArcball.getQuat() ); //NOTE: for debugging
gl::scale(Vec3f(0.035,0.035,0.035));
glLineWidth(0.2f);
gl::enableWireframe();
gl::translate(Vec3f(280.0, 0.0, -180.0));
gl::rotate(Vec3f(-10.0, -10.0, 0.0));
gl::draw(mVbo);
gl::disableWireframe();
myImage.unbind();
gl::popMatrices();
}
gl::pushMatrices();
mFlowField->draw();
gl::popMatrices();
/*
glPushMatrix();
glColor4f(1.0, 0.0, 0.0, 1.0);
gl::drawSphere(Vec3f(userIncr1, userIncr2, userIncr3), 30.0, 12.0);
glPopMatrix();
*/
}
示例14: draw
void PointCloudApp::draw()
{
gl::clear(Color(0.25f, 0.1f, 0.15f));
//gl::enableAdditiveBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
gl::setMatrices(mMayaCam.getCamera());
gl::ScopedTextureBind cTexture(mTexRgb);
gl::pointSize(getWindowWidth()/mDepthDims.x);
mDrawObj->draw();
}
示例15: draw
void TessellationSampleApp::draw()
{
// clear out the window with black
// gl::clear( Color( 0, 0, 0 ) );
// gl::setMatricesWindow( getWindowWidth(), getWindowHeight() );
// gl::translate( getWindowCenter() );
// gl::ScopedGlslProg glslProg( mGlsl );
// mGlsl->uniform( "uNumSides", mNumSides );
// mGlsl->uniform( "uRadius", mRadius );
// mBatch->draw();
//glEnable(GL_DEPTH_TEST);
//glEnable(GL_CULL_FACE);
glUseProgram(shaderProgram);
glUniform1f( tessellationInnerLoc, mTessellationInner );
glUniform1f( tessellationOuterLoc, mTessellationOuter );
glUniform3f(ambientColorLoc, 0.04f, 0.04f, 0.04f);
glUniform3f(diffuseColorLoc, 0, 0.75, 0.75);
glUniform3f(lightPosLoc, 0.25, 0.25, 1);
//gl::setMatrices( mMayaCam.getCamera() );
glUniformMatrix4fv(projectionMatLoc, 1, GL_FALSE, mMayaCam.getCamera().getProjectionMatrix().m);
glUniformMatrix4fv(modelViewMatLoc, 1, GL_FALSE, mMayaCam.getCamera().getViewMatrix().m);
glUniformMatrix4fv(normalMatLoc, 1, GL_FALSE, mNormalMatrix.m);
glClearColor(0.7f, 0.6f, 0.5f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//glPatchParameteri(GL_PATCH_VERTICES, 3); // triggers a crash for some reason...
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
//glDrawArrays(GL_PATCHES, 0, 4);
glDrawElements(GL_PATCHES, mIndexCount, GL_UNSIGNED_INT, 0);
glUseProgram( 0 );
}