void VboMeshSampleApp::mouseWheel( MouseEvent event )
{
	// Zoom in/out with mouse wheel
	Vec3f eye = mCamera.getEyePoint();
	eye.z += event.getWheelIncrement() * 0.1f;
	mCamera.setEyePoint( eye );
}
Exemplo n.º 2
0
  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();
    }
  }
Exemplo n.º 3
0
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 );
	}
}
Exemplo n.º 4
0
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() );
}
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);
	}
}
Exemplo n.º 6
0
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();
}
Exemplo n.º 7
0
// 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" );
}
Exemplo n.º 8
0
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() );
}
Exemplo n.º 9
0
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 ) );
}
Exemplo n.º 10
0
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 );
	}
}
Exemplo n.º 11
0
void BulletTestApp::resize( ResizeEvent event )
{
    // Reset camera
    mCamera.setPerspective( 60.0f, getWindowAspectRatio(), 1.0f, 5000.0f );
    mCamera.lookAt( Vec3f( 0.0f, 0.0f, -300.0f ), Vec3f::zero() );
    gl::setMatrices( mCamera );

    // Set up OpenGL
    glEnable( GL_BLEND );
    glEnable( GL_DEPTH_TEST );
    gl::enable( GL_TEXTURE_2D );
    glShadeModel( GL_SMOOTH );
    glEnable( GL_POLYGON_SMOOTH );
    glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
    glEnable( GL_LIGHTING );
    glEnable( GL_NORMALIZE );
    gl::enableAlphaBlending();
    glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
}
// 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 );
}
Exemplo n.º 13
0
// 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 );

}
Exemplo n.º 14
0
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 );
}
Exemplo n.º 15
0
// Handles window resize
void MeshApp::resize()
{

	// Reset camera
	mEyePoint = Vec3f( 0.0f, 0.0f, 100.0f );
	mLookAt = Vec3f::zero();
	mRotation = Vec3f::zero();
	mCamera.lookAt( mEyePoint, mLookAt );
	mCamera.setPerspective( 60.0f, getWindowAspectRatio(), 0.1f, 15000.0f );

	// Set up OpenGL
	gl::enable( GL_DEPTH_TEST );
	glHint( GL_POLYGON_SMOOTH_HINT, GL_NICEST );
	gl::enable( GL_POLYGON_SMOOTH );
	gl::enableDepthRead();
	gl::enableDepthWrite();
	gl::enableAlphaBlending();
	glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
	gl::color( ColorAf::white() );

}
Exemplo n.º 16
0
// Runs update logic
void MeshApp::update()
{

	// Update frame rate
	mFrameRate = getAverageFps();

	// Toggle fullscreen
	if ( mFullScreen != mFullScreenPrev ) {
		setFullScreen( mFullScreen );
		mFullScreenPrev = mFullScreen;
	}

	// Toggle background
	if ( mRemoveBackground != mRemoveBackgroundPrev ) {
		mKinect->removeBackground( mRemoveBackground );
		mRemoveBackgroundPrev = mRemoveBackground;
	}

	// Kinect is running
	if ( mKinect->isCapturing() ) {
		mKinect->update();

		// Find first active skeleton...
		for ( vector<Skeleton>::const_iterator skeletonIt = mSkeletons.cbegin(); skeletonIt != mSkeletons.cend(); ++skeletonIt ) {

			// Valid skeletons have all joints available
			if ( skeletonIt->size() == (uint32_t)JointName::NUI_SKELETON_POSITION_COUNT ) {

				// Subtle camera follow
				Vec3f spine = skeletonIt->at( JointName::NUI_SKELETON_POSITION_SPINE ).getPosition() * mEyePoint.z;
				mLookAt.x = spine.x * 0.05f;
				mLookAt.y = spine.y * 0.05f;
				mEyePoint.x = -mLookAt.x * 0.5f;
				mEyePoint.y = -mLookAt.y * 0.25f;

			}

		}

	} else {

		// If Kinect initialization failed, try again every 90 frames
		if ( getElapsedFrames() % 90 == 0 ) {
			mKinect->start();
		}

	}

	// Update camera
	mCamera.lookAt( mEyePoint, mLookAt );

}
Exemplo n.º 17
0
void GpGpuApp::update()
{
	mFrameRate = getAverageFps();
	
	// Toggle full screen mode
	if ( mFullScreenPrev != mFullScreen ) {
		setFullScreen( mFullScreen );
		mFullScreenPrev = mFullScreen;
	}
	
	// Reset the FBOs if our grid size changes
	if ( mSizePrev != mSize ) {
		
		// Reset FBO index
		mFboIndex = 0;
		
		// We're going to create two FBOs, each with three color attachments
		gl::Fbo::Format format;
		format.enableColorBuffer( true, 3 );
		format.setColorInternalFormat( GL_RGBA32F_ARB );
		for ( size_t i = 0; i < 2; ++i ) {
			
			// Create the FBO
			mFbo[ i ]	= gl::Fbo( mSize.x, mSize.y, format );
			Area bounds = mFbo[ i ].getBounds();
			
			// Bind the FBO so we can draw on it
			mFbo[ i ].bindFramebuffer();
			
			// Configure the view
			gl::setViewport( bounds );
			gl::setMatricesWindow ( mSize );
			
			// This lets us target the three color attachments together
			glDrawBuffers( 3, kColorAttachments );
			
			// Fill in all attachments with grey
			gl::color( ColorAf::gray( 0.5f ) );
			gl::drawSolidRect( bounds );
			
			// Unbind the FBO so we are no longer drawing to it
			mFbo[ i ].unbindFramebuffer();
		}
		
		mSizePrev = mSize;
	}
	
	// Update camera position
	mCamera.lookAt( mEyePoint, Vec3f::zero() );
	
}
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 );
}
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 );
}
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);
}
Exemplo n.º 21
0
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" );
}
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);
}
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);
}
Exemplo n.º 24
0
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 );
    
    
    //mParams.addText("the distance between A and B is" , dist);
    

    mParams.addText( " ");
    mParams.addText( "Follow joints:");
    
    vector<string> joints = { "Head", "Neck", "Left Shoulder", "Left Elbow", "Left Hand", "Right Shoulder", "Right Elbow", "Right Hand", "Torso", "Left Hip", "Left Knee", "Left Foot", "Right Hip",  "Right Knee",  "Right Foot" };
    for ( int i=0; i<joints.size(); i++ ) {
        Boolean *thing = &mShowJoints[i];
        mParams.addParam(joints[i], &mShowJoints[i]);
    }
    
}
Exemplo n.º 25
0
void _TBOX_PREFIX_App::resize( int width, int height )
{
	mCam.lookAt( Vec3f( 3, 2, -3 ), Vec3f::zero() );
	mCam.setPerspective( 60, width / (float)height, 1, 1000 );
}
Exemplo n.º 26
0
  RootController(ci::JsonTree& params,
                 ci::TimelineRef timeline,
                 Event<std::vector<Touch> >& touch_event) noexcept :
    params_(params),
    timeline_(timeline),
    ui_camera_(createCamera(params["ui_view.camera"])),
    fov_(ui_camera_.getFov()),
    near_z_(ui_camera_.getNearClip()),
    far_z_(ui_camera_.getFarClip()),
    autolayout_(ui_camera_),
    touch_event_(touch_event),
    view_creator_(params, timeline, ui_camera_, autolayout_, event_, touch_event),
    sound_(params["sounds"]),
    background_(Json::getColor<float>(params["app.background"])),
    records_(params["version"].getValue<float>())
  {
    DOUT << "RootController()" << std::endl;
    
    event_.connect("begin-progress",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<ProgressController>(params_, timeline_, event_,
                                                       view_creator_.create("ui_progress.json"));
                   });
    
    event_.connect("begin-gameover",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<GameoverController>(params_, timeline_, event_,
                                                       param,
                                                       view_creator_.create("ui_gameover.json"));
                   });

    event_.connect("begin-stageclear",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<StageclearController>(params_, timeline_, event_, param,
                                                         view_creator_.create("ui_stageclear.json"));
                   });

    event_.connect("begin-pause",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<PauseController>(params_, timeline_, event_,
                                                    view_creator_.create("ui_pause.json"));
                   });

    event_.connect("begin-records",
                   [this](const Connection&, EventParam& param) noexcept {
                     EventParam records = {
                       { "total_play",  records_.getTotalPlayNum() },
                       { "total_time",  records_.getTotalPlayTime() },
                       { "high_score",  records_.getHighScore() },
                       { "total_item",  records_.getTotalItemNum() },
                       { "stage_ranks", records_.stageRanks() },
                     };
                     
                     addController<RecordsController>(params_, timeline_, event_, records,
                                                      view_creator_.create("ui_records.json"));
                   });

    event_.connect("begin-credits",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<CreditsController>(params_, timeline_, event_,
                                                      view_creator_.create("ui_credits.json"));
                   });

    event_.connect("begin-title",
                   [this](const Connection&, EventParam& param) noexcept {
                     startTitle(param);
                   });

    event_.connect("begin-settings",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<SettingsController>(params_, timeline_, event_, records_,
                                                       view_creator_.create("ui_settings.json"));
                   });

    event_.connect("begin-regulat-stageclear",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<AllStageClearController>(params_["regular_stageclear"], timeline_, event_,
                                                            param,
                                                            view_creator_.create("ui_regularstageclear.json"));
                   });

    event_.connect("begin-all-stageclear",
                   [this](const Connection&, EventParam& param) noexcept {
                     addController<AllStageClearController>(params_["all_stageclear"], timeline_, event_,
                                                            param,
                                                            view_creator_.create("ui_allstageclear.json"));
                   });

    // GameOver時に色々チェック
    event_.connect("check-after-gameover",
                   [this](const Connection&, EventParam& param) noexcept {
                     DOUT << "check-after-gameover" << std::endl;
                     Rating::popup([this]() {
                         AppSupport::pauseDraw(true);
                       },
                       [this]() {
                         AppSupport::pauseDraw(false);
                       });
                     Achievment::atGameOver(records_);
                   });

    // サウンド再生
    event_.connect("sound-play",
                   [this](const Connection&, EventParam& param) noexcept {
                     auto& name = boost::any_cast<const std::string&>(param.at("sound"));
                     player_.play(name);
                     // DOUT << "sound:" << name << std::endl;
                   });

    
    event_.connect("se-silent",
                   [this](const Connection&, EventParam& param) noexcept {
                     sound_.setBufferSilent(boost::any_cast<bool>(param["silent"]));
                   });

    event_.connect("bgm-silent",
                   [this](const Connection&, EventParam& param) noexcept {
                     sound_.setFileSilent(boost::any_cast<bool>(param["silent"]));
                   });

    
#ifdef DEBUG
    event_.connect("force-regular-completed",
                   [this](const Connection&, EventParam& param) noexcept {
                     records_.forceRegularStageComplated();
                   });

    event_.connect("cancel-regular-completed",
                   [this](const Connection&, EventParam& param) noexcept {
                     records_.cancelRegularStageComplated();
                   });

    event_.connect("clear-records",
                   [this](const Connection&, EventParam& param) noexcept {
                     records_ = Records(params_["version"].getValue<float>());
                   });

    event_.connect("do-snapshot",
                   [this](const Connection&, EventParam& param) noexcept {
                     auto surface = ci::app::copyWindowSurface();
                     auto full_path = getDocumentPath() / std::string("snapshot" + createUniquePath() + ".png");
                     ci::writeImage(full_path, surface);
                   });
    
    event_.connect("reset-records",
                   [this](const Connection&, EventParam& param) noexcept {
                     records_ = Records(params_["version"].getValue<float>());
                   });
    
    event_.connect("reset-achievement",
                   [this](const Connection&, EventParam& param) noexcept {
                     DOUT << "reset-achievement" << std::endl;
                     GameCenter::resetAchievement();
                   });
#endif

    records_.load(params["game.records"].getValue<std::string>());
    
    sound_.setBufferSilent(!records_.isSeOn());
    sound_.setFileSilent(!records_.isBgmOn());
      
    addController<FieldController>(params, touch_event_, event_, records_);

    addController<IntroController>(params_, timeline_, event_,
                                   records_.getTotalPlayNum(),
                                   view_creator_.create("ui_intro.json"));

    // 自動PAUSE
    // getSignalDidEnterBackground(Backgroundになった直後)
    // getSignalWillResignActive(アクティブでなくなる直前)
    resign_active_ = ci::app::App::get()->getSignalWillResignActive().connect([this]() noexcept {
        DOUT << "SignalWillResignActive" << std::endl;
        EventParam params = {
          { "force", true }
        };
        event_.signal("pause-agree", params);
        
        GameCenter::writeCachedAchievement();
      });
  }
Exemplo n.º 27
0
void GpGpuApp::draw()
{
	// We're going to draw new data onto the "ping" FBO,
	// using the "pong" FBO's textures as input
	size_t pong = ( mFboIndex + 1 ) % 2;
	
	// Set up OpenGL for data
	gl::disableDepthRead();
	gl::disableDepthWrite();
	gl::setViewport( mFbo[ mFboIndex ].getBounds() );
	gl::color( ColorAf::white() );
	
	// Draw any new input onto the acceleration texture
	mFbo[ pong ].bindFramebuffer();
	glDrawBuffer( GL_COLOR_ATTACHMENT2 );
	if ( mMouseDown ) {
		Vec2f fboSize	= Vec2f( mFbo[ mFboIndex ].getSize() );
		Vec2f winSize	= Vec2f( app::getWindowSize() );
		
		gl::setMatricesWindow( fboSize, true );
		
		Vec2f brushSize	= Vec2f::one() * mBrushSize * fboSize;
		Vec2f pos		= ( mMouse / winSize );
		pos.y			= 1.0f - pos.y;
		pos				*= fboSize;
		
		mGlslProgGpGpu0->bind();
		mGlslProgGpGpu0->uniform( "color", ColorAf( mMouseVelocity.x, 0.0f, 1.0f - mMouseVelocity.y, 1.0f ) );
		mGlslProgGpGpu0->uniform( "tex", 0 );
		
		gl::enable( GL_TEXTURE_2D );
		mTextureBrush->bind();
		gl::drawSolidRect( Rectf( pos - brushSize, pos + brushSize ) );
		mTextureBrush->unbind();
		gl::disable( GL_TEXTURE_2D );
		
		mGlslProgGpGpu0->unbind();
	}
	mFbo[ pong ].unbindFramebuffer();
	
	// Now let's do an update pass in GLSL
	mFbo[ mFboIndex ].bindFramebuffer();
	gl::setMatricesWindow( mFbo[ mFboIndex ].getSize(), false );
	
	// Bind the "pong" textures to use as input data
	for ( int32_t i = 0; i < 3; ++i ) {
		mFbo[ pong ].bindTexture( i, i );
	}
	
	// Set up shader to read data textures
	mGlslProgGpGpu1->bind();
	mGlslProgGpGpu1->uniform( "offsets",		0 );
	mGlslProgGpGpu1->uniform( "velocities",		1 );
	mGlslProgGpGpu1->uniform( "acceleration",	2 );
	
	// Draw a rect to process data
	glDrawBuffers( 3, kColorAttachments );
	gl::drawSolidRect( mFbo[ pong ].getBounds() );
	
	// Unbind everything
	mFbo[ pong ].unbindTexture();
	mGlslProgGpGpu1->unbind();
	mFbo[ mFboIndex ].unbindFramebuffer();
	
	// Swap FBOs
	mFboIndex = pong;
	
	/////////////////////////////////
	
	// Make sure we have data to work with before we draw geometry
	if ( mFbo[ mFboIndex ] &&
		mFbo[ mFboIndex ].getTexture( 0 ) &&
		mFbo[ mFboIndex ].getTexture( 1 ) ) {
		
		// Set up window for 3D drawing
		gl::clear( Colorf( 0.5f, 0.45f, 0.4f ) );
		gl::setViewport( getWindowBounds() );
		gl::setMatrices( mCamera );
		gl::enableDepthRead();
		gl::enableDepthWrite();
		gl::multModelView( mArcball.getQuat() );
		gl::color( ColorAf::black() );
		
		// Set up shader to render scene
		mGlslProgDraw->bind();
		mGlslProgDraw->uniform( "Ax",			mLightAmbient );
		mGlslProgDraw->uniform( "Ac",			mLightAttenuationConstant );
		mGlslProgDraw->uniform( "Al",			mLightAttenuationLinear );
		mGlslProgDraw->uniform( "Aq",			mLightAttenuationQuadratic );
		mGlslProgDraw->uniform( "Dx",			mLightDiffuse );
		mGlslProgDraw->uniform( "eyePoint",		mEyePoint );
		mGlslProgDraw->uniform( "Ka",			mMaterialAmbient );
		mGlslProgDraw->uniform( "Kd",			mMaterialDiffuse );
		mGlslProgDraw->uniform( "Ke",			mMaterialEmissive );
		mGlslProgDraw->uniform( "Ks",			mMaterialSpecular );
		mGlslProgDraw->uniform( "lightPos",		mLightPosition );
		mGlslProgDraw->uniform( "n",			mLightShine );
		mGlslProgDraw->uniform( "offsets",		0 );
		mGlslProgDraw->uniform( "projection",	mCamera.getProjectionMatrix() );
		mGlslProgDraw->uniform( "size",			Vec2f( mSize ) );
		mGlslProgDraw->uniform( "Sx",			mLightSpecular );
		mGlslProgDraw->uniform( "t",			(float)getElapsedSeconds() );
		
		// Bind textures to use as input data
		for ( int32_t i = 0; i <= 2; ++i ) {
			mFbo[ mFboIndex ].bindTexture( i, i );
		}
		
		// Draw instanced
		drawInstanced( mMesh, mSize.x * mSize.y );
		
		// Finished drawing
		mFbo[ mFboIndex ].unbindTexture();
		mGlslProgDraw->unbind();
		
		// Draw textures so we can see what's going on under the hood
		gl::setMatricesWindow( getWindowSize() );
		gl::disableDepthRead();
		gl::disableDepthWrite();
		gl::color( ColorAf::white() );
		gl::pushMatrices();
		
		float x = 20.0f;
		float y = 440.0f;
		
		float width = 64.0f;
		Area srcArea( Vec2i::zero(), mSize );
		Rectf destRect( x, y, x + width, y + width );
		
		gl::draw( mFbo[ 0 ].getTexture( 0 ), srcArea, destRect );
		destRect.x1 += width;
		destRect.x2 += width;
		gl::draw( mFbo[ 1 ].getTexture( 0 ), srcArea, destRect );
		
		destRect.y1 += width;
		destRect.y2 += width;
		destRect.x1 = x;
		destRect.x2 = x + width;
		gl::draw( mFbo[ 0 ].getTexture( 1 ), srcArea, destRect );
		destRect.x1 += width;
		destRect.x2 += width;
		gl::draw( mFbo[ 1 ].getTexture( 1 ), srcArea, destRect );
		
		destRect.y1 += width;
		destRect.y2 += width;
		destRect.x1 = x;
		destRect.x2 = x + width;
		gl::draw( mFbo[ 0 ].getTexture( 2 ), srcArea, destRect );
		destRect.x1 += width;
		destRect.x2 += width;
		gl::draw( mFbo[ 1 ].getTexture( 2 ), srcArea, destRect );
		gl::popMatrices();
	}
	
	// Draw parameters
	if ( getElapsedFrames() > 1 ) { // This condition prevents a memory leak
		mParams->draw();
	}
}
Exemplo n.º 28
0
void BulletTestApp::mouseWheel( MouseEvent event )
{
	mCamera.setEyePoint( mCamera.getEyePoint() + Vec3f( 0.0f, 0.0f, event.getWheelIncrement() * 20.0f ) );
}
Exemplo n.º 29
0
void GpGpuApp::resize()
{
	mCamera.setAspectRatio( getWindowAspectRatio() );
}
Exemplo n.º 30
0
void TextTestApp::setup()
{
	hideBackground = false;
	activeUserPresent = false;
	// SET UP BLUR STUFF
	// setup our scene Fbo
	mFboScene = gl::Fbo( getWindowWidth(), getWindowHeight() );

	// setup our blur Fbo's, smaller ones will generate a bigger blur
	mFboBlur1 = gl::Fbo(getWindowWidth()/8, getWindowHeight()/8);
	mFboBlur2 = gl::Fbo(getWindowWidth()/8, getWindowHeight()/8);

	
	OutlineParams::getInstance()->init();

	// load and compile the shaders
	try { 
		mShaderBlur = gl::GlslProg( 
			loadFile("../shaders/blur_vert.glsl"),
			loadFile("../shaders/blur_frag.glsl")); 
	} catch(...) {
		console() << "Can't load/compile blur shader" << endl;
		quit();
	}

	try { 
		mShaderPhong = gl::GlslProg( 
			loadFile("../shaders/phong_vert.glsl"),
			loadFile("../shaders/phong_frag.glsl")); 
	} catch(...) {
		console() << "Can't load/compile phong shader" << endl;
		quit();
	}


	mTransform.setToIdentity();

	gestureTracker = GestureTracker::getInstance();

	gl::Texture::Format format;
	format.enableMipmapping(true);

	mCamera.setEyePoint( Vec3f(2.5f, 5.0f, 5.0f) );
	mCamera.setCenterOfInterestPoint( Vec3f(0.0f, 2.0f, 0.0f) );
	mCamera.setPerspective( 60.0f, getWindowAspectRatio(), 1.0f, 1000.0f );

	for (int i=0; i<40; i++)
	{
		CinderClip cinderClip = CinderClip();
		cinderClip.x = -200;
		cinderClip.y = -200;
		repelClips.push_back(cinderClip);

		////
	//	TweenParticle userParticle = TweenParticle(cinderClip.x, cinderClip.y,10,true);
		//userParticles.push_back(userParticle);
	}

	mbackground.setup();
	mbackground.setRepelClips( repelClips ); // I KNOW THEY ON SCREEN

	//load store config
	cinder::XmlTree configXml(ci::app::loadAsset( "shopconfig.xml" ) );
	ShopConfig::getInstance()->parseConfig(configXml);

	ci::gl::Texture bubbleManWaveTexture = cinder::loadImage(ci::app::loadResource(BUBBLEMAN_WAVE));

	mBubbleManWave = new SpriteSheet();
	mBubbleManWave->init(bubbleManWaveTexture, "./spritesheetdata/bubbleman_wave.xml", SpriteSheet::FORMAT_TEXTUREPACKER_GENERIC_XML);

	ci::gl::Texture bubbleManRunTexture = cinder::loadImage(ci::app::loadResource(BUBBLEMAN_RUN));
	mBubbleManRun = new SpriteSheet();
	mBubbleManRun->init(bubbleManRunTexture, "./spritesheetdata/bubbleman_run.xml", SpriteSheet::FORMAT_TEXTUREPACKER_GENERIC_XML);
	
	TextureGlobals::getInstance()->setSpriteSheet(mBubbleManRun,TextureGlobals::SPRITE_BUBBLEMAN_RUN);
	TextureGlobals::getInstance()->setSpriteSheet(mBubbleManWave,TextureGlobals::SPRITE_BUBBLEMAN_WAVE);

	gl::Texture particleTexture0 = loadImage(loadAsset( "ParticleFullON.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture0,0);

	gl::Texture particleTexture1 = loadImage(loadAsset( "ParticlePatial01.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture1,1);

	gl::Texture particleTexture2 = loadImage(loadAsset( "ParticlePatial02.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture2,2);

	gl::Texture particleTexture3 = loadImage(loadAsset( "ParticlePatial03.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture3,3);

	gl::Texture particleTexture4 = loadImage(loadAsset( "ParticlePatial04.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture4,4);

	gl::Texture particleTexture5 = loadImage(loadAsset( "ParticlePatial05.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture5,5);

	gl::Texture particleTexture6 = loadImage(loadAsset( "background-particle.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture6,6);

	gl::Texture particleTexture7 = loadImage(loadAsset( "ParticleFullONYellow.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(particleTexture6,7);


	
	gl::Texture terms1Texture = loadImage(loadAsset( "terms1.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(terms1Texture,8);

	
	gl::Texture terms2Texture = loadImage(loadAsset( "terms2.png" ) ); 
	TextureGlobals::getInstance()->setParticleTexture(terms2Texture,9);

	//gl::Texture terms2Texture = loadImage(loadAsset( "terms2.png" ) ); 
	//TextureGlobals::getInstance()->setParticleTexture(particleTexture6,9);

	myFont = FontRenderer();

	fgParticles.setup( 100 );
	fgParticles.setRepelClips(repelClips);

	// TO VIEW ACTIVE SCENE
	//currentScene = new ActiveScene1();
	//currentScene->getSignal()->connect( boost::bind(&TextTestApp::onPassiveSceneComplete, this, ::_1 ));
	//currentScene->setup( myFont, iconFactory, fgParticles );

	currentScene = new PassiveScene1();
	currentScene->getSignal()->connect( boost::bind(&TextTestApp::onPassiveSceneComplete, this ));
	currentScene->setup( myFont, iconFactory, fgParticles, mbackground.gridLayer1 );

	iconFactory.init();
	
	bgAnimationTimer = Timer();
	significantInteractionTimer = Timer();	
	setupSkeletonTracker();
}