Coder Social home page Coder Social logo

particles's Introduction

Particle Simulator

To use with open gazer (eye gaze guided particle motion):

Install and build Opengazer from http://www.inference.phy.cam.ac.uk/opengazer/#opengazerpreviousdownload (be sure to install all required libraries).

Open OutputMethods.cpp from the Opengazer project. In the function

void StreamStore::store(const TrackerOutput& output)

copy and paste the following directly under the line

id = (int) output.targetid;

//Copy and paste the following

//output coordinates to xyz.txt
ofstream fout("../../xyz.txt");
fout << x << " " << y;
fout << flush;
fout.close();

//output target to tar.txt
ofstream fidout ("../../tar.txt");
double tx = output.target.x;
double ty = output.target.y;
fidout << tx << " " << ty;
fidout << flush;
fidout.close();

This will read the Opengazer coordinates to two files. The xyz.txt file holds the Opengazer estimated coordinates and the tar.txt file holds the Opengazer closest target coordinates.

This program currently uses the xyz.txt estimated coordinates.

After following the calibration instructions in the Opengazer README, build and run this project.

Red spheres are control points, used to move the particles in a predefined way. The control particles can be modified in the constructor for SimpleSystem. The particles are affected by the induced velocity and attractive force of the control particles and by the Opengazer eye gaze tracking coordinates.

Remember to hold your head very still when using the programs, and a lamp positioned directly behind the webcam.


To compile and run the code, decompress the zip file into a directory, and type

$ make

Then, to run the code, you can pass the following parameters:

// To run the code with the default settings being Simple system, Gazer Method // and stepsize of .02, simply enter: $ a3

// Optional parameters: $ a3 integration_method step_size system_type

// integration method: choose either "e" for euler, or "t" for trapezoid // step_size: .02 seems to work best for cloth or pendulum. Slightly smaller is better for chain.

// system_type: There are 4 system types to choose from: "simple" "pendulum" "chain" and "cloth". Try them all! :D

// * Note * you have to specify all previous parameters to specify the system

Then, to play with the code: press "s" and the cloth will shake around press "w" and the particles will disappear just showing the wireframe


particles's People

Contributors

kkauff avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.