本文整理汇总了C++中ci::CameraPersp类的典型用法代码示例。如果您正苦于以下问题:C++ CameraPersp类的具体用法?C++ CameraPersp怎么用?C++ CameraPersp使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CameraPersp类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: setup
void UserApp::setup()
{
mBones.push_back( Bone( nite::JOINT_HEAD, nite::JOINT_NECK ) );
mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_LEFT_ELBOW ) );
mBones.push_back( Bone( nite::JOINT_LEFT_ELBOW, nite::JOINT_LEFT_HAND ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_SHOULDER, nite::JOINT_RIGHT_ELBOW ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_ELBOW, nite::JOINT_RIGHT_HAND ) );
mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_RIGHT_SHOULDER ) );
mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_TORSO ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_SHOULDER, nite::JOINT_TORSO ) );
mBones.push_back( Bone( nite::JOINT_TORSO, nite::JOINT_LEFT_HIP ) );
mBones.push_back( Bone( nite::JOINT_TORSO, nite::JOINT_RIGHT_HIP ) );
mBones.push_back( Bone( nite::JOINT_LEFT_HIP, nite::JOINT_RIGHT_HIP ) );
mBones.push_back( Bone( nite::JOINT_LEFT_HIP, nite::JOINT_LEFT_KNEE ) );
mBones.push_back( Bone( nite::JOINT_LEFT_KNEE, nite::JOINT_LEFT_FOOT ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_HIP, nite::JOINT_RIGHT_KNEE ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_KNEE, nite::JOINT_RIGHT_FOOT ) );
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 45.0f, 1.0f, 5000.0f );
mCamera.lookAt( Vec3f::zero(), Vec3f::zAxis(), Vec3f::yAxis() );
mDeviceManager = OpenNI::DeviceManager::create();
try {
mDevice = mDeviceManager->createDevice( OpenNI::DeviceOptions().enableUserTracking() );
} catch ( OpenNI::ExcDeviceNotAvailable ex ) {
console() << ex.what() << endl;
quit();
return;
}
mDevice->getUserTracker().setSkeletonSmoothingFactor( 0.5f );
mDevice->connectUserEventHandler( &UserApp::onUser, this );
mDevice->start();
}
开发者ID:Potion,项目名称:Cinder-OpenNI,代码行数:34,代码来源:UserApp.cpp
示例2: setup
// Set up
void LeapApp::setup()
{
// Set up OpenGL
gl::enable( GL_LINE_SMOOTH );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
gl::enable( GL_POLYGON_SMOOTH );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
// Set up camera
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 0.01f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 125.0f, 500.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
// Start device
mLeap = Device::create();
mLeap->addCallback( &LeapApp::onFrame, this );
// Params
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl( "Params", Vec2i( 200, 105 ) );
mParams.addParam( "Frame rate", &mFrameRate, "", true );
mParams.addParam( "Full screen", &mFullScreen, "key=f" );
mParams.addButton( "Screen shot", bind( &LeapApp::screenShot, this ), "key=space" );
mParams.addButton( "Quit", bind( &LeapApp::quit, this ), "key=q" );
}
开发者ID:gaborpapp,项目名称:Cinder-LeapSdk,代码行数:26,代码来源:LeapApp.cpp
示例3: setup
void LeapPalmDirectionApp::setup()
{
mLeap = LeapSdk::Device::create();
mCallbackId = mLeap->addCallback( &LeapPalmDirectionApp::onFrame, this );
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 0.01f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 250.0f, 500.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
}
开发者ID:gaborpapp,项目名称:apps,代码行数:8,代码来源:LeapPalmDirectionApp.cpp
示例4: setup
// Set up
void TracerApp::setup()
{
// Set up camera
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 0.01f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 93.75f, 250.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
// Start device
mDevice = Device::create();
mDevice->connectEventHandler( &TracerApp::onFrame, this );
// Load shaders
try {
mShader[ 0 ] = gl::GlslProg( loadResource( RES_GLSL_PASS_THROUGH_VERT ), loadResource( RES_GLSL_BLUR_X_FRAG ) );
} catch ( gl::GlslProgCompileExc ex ) {
console() << "Unable to compile blur X shader: \n" << string( ex.what() ) << "\n";
quit();
}
try {
mShader[ 1 ] = gl::GlslProg( loadResource( RES_GLSL_PASS_THROUGH_VERT ), loadResource( RES_GLSL_BLUR_Y_FRAG ) );
} catch ( gl::GlslProgCompileExc ex ) {
console() << "Unable to compile blur Y shader: \n" << string( ex.what() ) << "\n";
quit();
}
// Params
mFrameRate = 0.0f;
mParams = params::InterfaceGl( "Params", Vec2i( 200, 105 ) );
mParams.addParam( "Frame rate", &mFrameRate, "", true );
mParams.addButton( "Screen shot", bind( &TracerApp::screenShot, this ), "key=space" );
mParams.addButton( "Quit", bind( &TracerApp::quit, this ), "key=q" );
// Enable polygon smoothing
gl::enable( GL_POLYGON_SMOOTH );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
// Set up FBOs
gl::Fbo::Format format;
#if defined( CINDER_MSW )
format.setColorInternalFormat( GL_RGBA32F );
#else
format.setColorInternalFormat( GL_RGBA32F_ARB );
#endif
format.setMinFilter( GL_LINEAR );
format.setMagFilter( GL_LINEAR );
format.setWrap( GL_CLAMP, GL_CLAMP );
for ( size_t i = 0; i < 3; ++i ) {
mFbo[ i ] = gl::Fbo( getWindowWidth(), getWindowHeight(), format );
mFbo[ i ].bindFramebuffer();
gl::setViewport( mFbo[ i ].getBounds() );
gl::clear();
mFbo[ i ].unbindFramebuffer();
}
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
}
开发者ID:modbert,项目名称:RapidPrototyping-LeapMotion,代码行数:56,代码来源:TracerApp.cpp
示例5: setup
void CinderProjectApp::setup()
{
// Set up OpenGL
gl::enableAlphaBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
// Set up camera
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 0.01f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 125.0f, 500.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
// Start device
mLeap = LeapMotion::Device::create();
mLeap->connectEventHandler( &CinderProjectApp::onFrame, this );
}
开发者ID:modbert,项目名称:RapidPrototyping-LeapMotion,代码行数:15,代码来源:CinderProjectApp_original.cpp
示例6: setup
void _TBOX_PREFIX_App::setup()
{
// Set up OpenGL
gl::enableAlphaBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
// Set up camera
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 0.01f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 125.0f, 500.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
// Start device
mLeap = LeapSdk::Device::create();
mCallbackId = mLeap->addCallback( &_TBOX_PREFIX_App::onFrame, this );
}
开发者ID:valentebruno,项目名称:Cinder-LeapSdk,代码行数:15,代码来源:_TBOX_PREFIX_App.cpp
示例7: resetCamera
void PaintingBeingsApp::resetCamera()
{
float eyeZ = static_cast<float>(_rectangleTextutre.getWidth()) * 2.5f;
if (_showImageBeing)
eyeZ = static_cast<float>(_image.getMiniatureSize()) * 2.5f;
float radiusArcBall = static_cast<float>(getWindowHeight() * 0.5f);
float fieldOfView = 75.0f;
float nearCamera = 0.1f;
float farCamera = 1000000.0f;
_camera = CameraPersp(getWindowWidth(), getWindowHeight(), fieldOfView, nearCamera, farCamera);
_camera.lookAt(Vec3f(0.0f, 0.0f, eyeZ), Vec3f::zero());
_arcball = Arcball(getWindowSize());
_arcball.setRadius(radiusArcBall);
}
开发者ID:3a-arthurkevin,项目名称:PaintingBeings,代码行数:18,代码来源:PaintingBeingsApp.cpp
示例8: setup
void LeapApp::setup()
{
gl::enable( GL_LINE_SMOOTH );
glHint( GL_LINE_SMOOTH_HINT, GL_NICEST );
gl::enable( GL_POLYGON_SMOOTH );
glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 60.0f, 1.0f, 1000.0f );
mCamera.lookAt( Vec3f( 0.0f, 250.0f, 500.0f ), Vec3f( 0.0f, 250.0f, 0.0f ) );
mDevice = Device::create();
mDevice->connectEventHandler( &LeapApp::onFrame, this );
mFrameRate = 0.0f;
mFullScreen = false;
mParams = params::InterfaceGl::create( "Params", Vec2i( 200, 105 ) );
mParams->addParam( "Frame rate", &mFrameRate, "", true );
mParams->addParam( "Full screen", &mFullScreen ).key( "f" );
mParams->addButton( "Screen shot", bind( &LeapApp::screenShot, this ), "key=space" );
mParams->addButton( "Quit", bind( &LeapApp::quit, this ), "key=q" );
}
开发者ID:num3ric,项目名称:Cinder-LeapMotion,代码行数:21,代码来源:LeapApp.cpp
示例9: setup
void PaintingBeingsApp::setup()
{
setStop();
// Setup des paramètres de OpenGL
glShadeModel(GL_SMOOTH);
gl::enable(GL_POLYGON_SMOOTH);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
gl::enableAlphaBlending();
gl::enableDepthRead();
gl::enableDepthWrite();
// Setup Capture webcam
_capture = Capture(640, 480);
_capture.start();
// Setup camera
float fieldOfView = 75.0f;
float nearCamera = 0.1f;
float farCamera = 1000000.0f;
_camera = CameraPersp(getWindowWidth(), getWindowHeight(), fieldOfView, nearCamera, farCamera);
_camera.lookAt(Vec3f(0.0f, 0.0f, 50.0f), Vec3f::zero());
// Setup arcball (camera rotation)
float radiusArcBall = static_cast<float>(getWindowHeight() * 0.5f);
_arcball = Arcball(getWindowSize());
_arcball.setRadius(radiusArcBall);
// Génération de la population d'ImageBeing
_imageBeing = ImageBeing();
_rectangleAlgoGen.set(-75.0f, 25.0f, -25.0f, -25.0f);
_rectangleTextutre.set(25.0f, 25.0f, 75.0f, -25.0f);
// Setup de l'interface
_params = params::InterfaceGl("Options", Vec2i(200, 400));
updateInterface(false);
}
开发者ID:3a-arthurkevin,项目名称:PaintingBeings,代码行数:40,代码来源:PaintingBeingsApp.cpp
示例10: cameraDrawBillboard
void ZoaDebugFunctions::cameraDrawBillboard( const ci::CameraPersp &camera, ci::Vec2f position )
{
ci::Vec3f mRight, mUp;
camera.getBillboardVectors(&mRight, &mUp);
ci::gl::drawBillboard( ci::Vec3f::zero(), position, 0.0f, mRight, mUp);
}
开发者ID:onedayitwillmake,项目名称:QuadDistrust,代码行数:6,代码来源:ZoaDebugFunctions.cpp
示例11: setup
void UserApp::setup()
{
mShapeDetection = ShapeDetection();
// mBones.push_back( Bone( nite::JOINT_HEAD, nite::JOINT_NECK ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_LEFT_ELBOW ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_ELBOW, nite::JOINT_LEFT_HAND ) );
// mBones.push_back( Bone( nite::JOINT_RIGHT_SHOULDER, nite::JOINT_RIGHT_ELBOW ) );
// mBones.push_back( Bone( nite::JOINT_RIGHT_ELBOW, nite::JOINT_RIGHT_HAND ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_RIGHT_SHOULDER ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_TORSO ) );
// mBones.push_back( Bone( nite::JOINT_RIGHT_SHOULDER, nite::JOINT_TORSO ) );
// mBones.push_back( Bone( nite::JOINT_TORSO, nite::JOINT_LEFT_HIP ) );
// mBones.push_back( Bone( nite::JOINT_TORSO, nite::JOINT_RIGHT_HIP ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_HIP, nite::JOINT_RIGHT_HIP ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_HIP, nite::JOINT_LEFT_KNEE ) );
// mBones.push_back( Bone( nite::JOINT_LEFT_KNEE, nite::JOINT_LEFT_FOOT ) );
// mBones.push_back( Bone( nite::JOINT_RIGHT_HIP, nite::JOINT_RIGHT_KNEE ) );
// mBones.push_back( Bone( nite::JOINT_RIGHT_KNEE, nite::JOINT_RIGHT_FOOT ) );
// POINTS
mBones.push_back( Bone( nite::JOINT_HEAD, nite::JOINT_HEAD ) ); //0
mBones.push_back( Bone( nite::JOINT_NECK, nite::JOINT_NECK ) ); //1
mBones.push_back( Bone( nite::JOINT_LEFT_SHOULDER, nite::JOINT_LEFT_SHOULDER ) ); //2
mBones.push_back( Bone( nite::JOINT_LEFT_ELBOW, nite::JOINT_LEFT_ELBOW ) ); //3
mBones.push_back( Bone( nite::JOINT_LEFT_HAND, nite::JOINT_LEFT_HAND ) ); //4
mBones.push_back( Bone( nite::JOINT_RIGHT_SHOULDER, nite::JOINT_RIGHT_SHOULDER ) ); //5
mBones.push_back( Bone( nite::JOINT_RIGHT_ELBOW, nite::JOINT_RIGHT_ELBOW ) ); //6
mBones.push_back( Bone( nite::JOINT_RIGHT_HAND, nite::JOINT_RIGHT_HAND ) ); //7
mBones.push_back( Bone( nite::JOINT_TORSO, nite::JOINT_TORSO ) ); //8
mBones.push_back( Bone( nite::JOINT_LEFT_HIP, nite::JOINT_LEFT_HIP ) ); //9
mBones.push_back( Bone( nite::JOINT_LEFT_KNEE, nite::JOINT_LEFT_KNEE ) ); //10
mBones.push_back( Bone( nite::JOINT_LEFT_FOOT, nite::JOINT_LEFT_FOOT ) ); //11
mBones.push_back( Bone( nite::JOINT_RIGHT_HIP, nite::JOINT_RIGHT_HIP ) ); //12
mBones.push_back( Bone( nite::JOINT_RIGHT_KNEE, nite::JOINT_RIGHT_KNEE ) ); //13
mBones.push_back( Bone( nite::JOINT_RIGHT_FOOT, nite::JOINT_RIGHT_FOOT ) ); //14
// DISTANCE LINES
// hand to hand
mBones.push_back( Bone( nite::JOINT_LEFT_HAND, nite::JOINT_RIGHT_HAND ) );
// limbs
mBones.push_back( Bone( nite::JOINT_LEFT_HAND, nite::JOINT_TORSO ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_HAND, nite::JOINT_TORSO ) );
mBones.push_back( Bone( nite::JOINT_LEFT_FOOT, nite::JOINT_RIGHT_HAND ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_FOOT, nite::JOINT_LEFT_HAND ) );
//surrounding body
mBones.push_back( Bone( nite::JOINT_RIGHT_FOOT, nite::JOINT_LEFT_FOOT ) );
mBones.push_back( Bone( nite::JOINT_LEFT_FOOT, nite::JOINT_LEFT_HAND ) );
mBones.push_back( Bone( nite::JOINT_LEFT_HAND, nite::JOINT_HEAD ) );
mBones.push_back( Bone( nite::JOINT_HEAD, nite::JOINT_RIGHT_HAND ) );
mBones.push_back( Bone( nite::JOINT_RIGHT_HAND, nite::JOINT_RIGHT_FOOT) );
mCamera = CameraPersp( getWindowWidth(), getWindowHeight(), 45.0f, 1.0f, 5000.0f );
mCamera.lookAt( Vec3f::zero(), Vec3f::zAxis(), Vec3f::yAxis() );
mDeviceManager = OpenNI::DeviceManager::create();
try {
mDevice = mDeviceManager->createDevice( OpenNI::DeviceOptions().enableUserTracking() );
} catch ( OpenNI::ExcDeviceNotAvailable ex ) {
console() << "exception with openni: " << ex.what() << endl;
quit();
return;
}
mDevice->getUserTracker().setSkeletonSmoothingFactor( 0.5f );
mDevice->connectUserEventHandler( &UserApp::onUser, this );
mDevice->start();
// vector of trails
for( int i=0; i<15; i++ ){
mTrails.push_back(TrailPoint());
mShowJoints.push_back(false);
// mShowJoints[i] = false;
}
mShowJoints[0] = true;
mColors.push_back( Color( 0.0f, 0.75f, 1.0f ) );
mColors.push_back( Color( 1.0f, 0.08f, 0.58f) );
mColors.push_back( Color( 1.0f, 0.0f, 1.0f ) );
mColors.push_back( Color( 0.0f, 1.0f, 1.0f ) );
mColors.push_back( Color( 0.0f, 1.0f, 0.0f ) );
mColors.push_back( Color( 0.48f, 0.41f, 0.93f ) );
mColors.push_back( Color( 0.6f, 0.2f, 0.8f ) );
mColors.push_back( Color( 0.12f, 0.56f, 1.0f ) );
mColors.push_back( Color( 0.0f, 0.81f, 0.82f ) );
mColors.push_back( Color( 0.75f, 0.75f, 0.75f ) );
mColors.push_back( Color( 0.54f, 0.17f, 0.87f ) );
mColors.push_back( Color( 1.0f, 0.08f, 0.58f ) );
mColors.push_back( Color( 1.0f, 1.0f, 1.0f ) );
mColors.push_back( Color( 0.29f, 0.0f, 0.51f ) );
mColors.push_back( Color( 0.0f, 0.0f, 1.0f ) );
// params window
mParams = params::InterfaceGl( "Parameters", Vec2i( 200, 500 ), ColorA( 0.0f, 0.0f, 0.0f, 0.5f ) );
mParams.addParam( "On Balance", &mUseBalance );
mParams.addParam( "Negative Space", &mShowNegativeSpace );
mParams.addParam( "Distance Lines", &mShowDistanceLines );
//.........这里部分代码省略.........
开发者ID:rossanag,项目名称:CCL,代码行数:101,代码来源:UserApp.cpp
示例12: mouseWheel
void VboMeshSampleApp::mouseWheel( MouseEvent event )
{
// Zoom in/out with mouse wheel
Vec3f eye = mCamera.getEyePoint();
eye.z += event.getWheelIncrement() * 0.1f;
mCamera.setEyePoint( eye );
}
开发者ID:bgstaal,项目名称:Cinder-MeshHelper,代码行数:7,代码来源:VboMeshSampleApp.cpp
示例13: resize
void resize() noexcept override {
float aspect = ci::app::getWindowAspectRatio();
ui_camera_.setAspectRatio(aspect);
if (aspect < 1.0) {
// 画面が縦長になったら、幅基準でfovを求める
// fovとnear_zから投影面の幅の半分を求める
float half_w = std::tan(ci::toRadians(fov_ / 2)) * near_z_;
// 表示画面の縦横比から、投影面の高さの半分を求める
float half_h = half_w / aspect;
// 投影面の高さの半分とnear_zから、fovが求まる
float fov = std::atan(half_h / near_z_) * 2;
ui_camera_.setFov(ci::toDegrees(fov));
}
else {
// 横長の場合、fovは固定
ui_camera_.setFov(fov_);
}
autolayout_.resize(ui_camera_);
for (auto& child : children_) {
child->resize();
}
}
开发者ID:kazukin134,项目名称:BrickAndTrip,代码行数:27,代码来源:RootController.hpp
示例14: mouseDown
void BulletTestApp::mouseDown( MouseEvent event )
{
Vec2f pos = Vec2f( event.getPos() ) / Vec2f( getWindowSize() );
pos.y = 1.0f - pos.y;
Ray ray = mCamera.generateRay( pos.x, pos.y, getWindowAspectRatio() );
mDragging = mWorld->intersects( ray, mCamera.getFarClip(), &mDragConstraint );
if ( mDragging ) {
mWorld->addConstraint( mDragConstraint, 0.0f, 0.01f );
}
}
开发者ID:degatt2,项目名称:Cinder-Bullet,代码行数:10,代码来源:BulletTestApp.cpp
示例15: setup
void BasicAnimationApp::setup()
{
auto kicking = "VC/glTF/VC.gltf";
mFile = gltf::File::create( loadAsset( kicking ) );
mScene = make_shared<gltf::simple::Scene>( mFile, &mFile->getDefaultScene() );
mCam.setPerspective( 60.0f, getWindowAspectRatio(), 0.01, 100000.0 );
mCam.lookAt( vec3( 0, 0, -6.0 ), vec3( 0 ) );
mCamUi.setCamera( &mCam );
mCamUi.connect( getWindow() );
}
开发者ID:ryanbartley,项目名称:gltf,代码行数:12,代码来源:BasicAnimationApp.cpp
示例16: mouseWheel
void PaintingBeingsApp::mouseWheel(MouseEvent event)
{
if (_launchAlgoGen)
{
Vec3f eye = _camera.getEyePoint();
eye.z -= event.getWheelIncrement() * 1.5f;
float eyeMaxZ = static_cast<float>(_image.getMiniatureSize()) * 10.0f;
if (eye.z > 1.0f && eye.z < eyeMaxZ)
_camera.setEyePoint(eye);
}
}
开发者ID:3a-arthurkevin,项目名称:PaintingBeings,代码行数:13,代码来源:PaintingBeingsApp.cpp
示例17: setup
void MetaBallsApp::setup()
{
try {
setupCl();
setupScene();
}
catch( const ocl::Error &e ) {
CI_LOG_E( e.what() << " " << ocl::errorToString( e.err() ) );
}
mCam.setPerspective( 60, ci::app::getWindowAspectRatio(), 0.01, 1000 );
mCam.lookAt( vec3( 10, 10, 10 ), vec3( 0, 0, 0 ) );
mCamUI.setCamera( &mCam );
mCamUI.connect( getWindow() );
}
开发者ID:ryanbartley,项目名称:Cinder-OpenCl,代码行数:16,代码来源:MetaBallsApp.cpp
示例18: mouseDrag
void BulletTestApp::mouseDrag( MouseEvent event )
{
if ( mDragging ) {
Vec2f pos = Vec2f( event.getPos() ) / Vec2f( getWindowSize() );
pos.y = 1.0f - pos.y;
Ray ray = mCamera.generateRay( pos.x, pos.y, getWindowAspectRatio() );
mDragConstraint.update( ray );
}
}
开发者ID:degatt2,项目名称:Cinder-Bullet,代码行数:9,代码来源:BulletTestApp.cpp
示例19: setup
// Set up
void SkeletonApp::setup()
{
// Start Kinect
mKinect = Kinect::create();
mKinect->start( DeviceOptions().enableDepth( false ).enableVideo( false ) );
mKinect->removeBackground();
// Set the skeleton smoothing to remove jitters. Better smoothing means
// less jitters, but a slower response time.
mKinect->setTransform( Kinect::TRANSFORM_SMOOTH );
// Add callback to receive skeleton data
mCallbackId = mKinect->addSkeletonTrackingCallback<SkeletonApp>( &SkeletonApp::onSkeletonData, this );
// Set up camera
mCamera.lookAt( Vec3f( 0.0f, 0.0f, 2.0f ), Vec3f::zero() );
mCamera.setPerspective( 45.0f, getWindowAspectRatio(), 0.01f, 1000.0f );
}
开发者ID:joshuajnoble,项目名称:Cinder-KinectSdk,代码行数:21,代码来源:SkeletonApp.cpp
示例20: setupSkeletonTracker
void TextTestApp::setupSkeletonTracker(){
// Start Kinect
mKinect = Kinect::create();
mKinect->start( DeviceOptions().enableVideo( false ).setDepthResolution( ImageResolution::NUI_IMAGE_RESOLUTION_320x240 ).enableUserTracking(true) );
mKinect->enableUserColor(true);
mKinect->removeBackground();
// Add callbacks
// Set the skeleton smoothing to remove jitters. Better smoothing means
// less jitters, but a slower response time.
mKinect->setTransform( Kinect::TRANSFORM_SMOOTH );
// Add callback to receive skeleton data
mCallbackId = mKinect->addSkeletonTrackingCallback( &TextTestApp::onSkeletonData, this );
// Set up camera
mCamera.lookAt( Vec3f( 0.0f, 0.0f, 2.0f ), Vec3f::zero() );
mCamera.setPerspective( 45.0f, getWindowAspectRatio(), 0.01f, 1000.0f );
}
开发者ID:proalias,项目名称:ee_app,代码行数:20,代码来源:TextTestApp.cpp
注:本文中的ci::CameraPersp类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论