Git Product home page Git Product logo

three.proton's Introduction

three.proton

three.proton is a magical 3d particle engine using three.js. It is based on the Proton Engine library. It inherited Proton's most api.
I think it is the simplest three.js particle engine.Check out examples at https://a-jie.github.io/three.proton/

Features

  • Four kinds of renderers

    • MeshRender
    • SpriteRender
    • PointsRender
    • CustomRender
  • Three kinds of emitters which can simulate many different physical effects

    • Emitter
    • BehaviourEmitter
    • FollowEmitter
  • Perfectly compatible with the three.js library.

It was very, very easy to use

Installation

Install using npm

anix

npm install three.proton.js --save
... 
import Proton from 'three.proton.js';

Include in html

<script type="text/javascript" src="js/three.proton.min.js"></script> 

Usage

var proton = new Proton();
var emitter = new Proton.Emitter();

//setRate
emitter.rate = new Proton.Rate(new Proton.Span(4, 16), new Proton.Span(.01));

//addInitialize
emitter.addInitialize(new Proton.Position(new Proton.PointZone(0, 0)));
emitter.addInitialize(new Proton.Mass(1));
emitter.addInitialize(new Proton.Radius(6, 12));
emitter.addInitialize(new Proton.Life(3));
emitter.addInitialize(new Proton.V(45, new Proton.Vector3D(0, 1, 0), 180));

//addBehaviour
emitter.addBehaviour(new Proton.Alpha(1, 0));
emitter.addBehaviour(new Proton.Scale(.1, 1.3));

var color1 = new THREE.Color();
var color2 = new THREE.Color();
var colorBehaviour = new Proton.Color(color1, color2);
emitter.addBehaviour(colorBehaviour);
emitter.emit();

//add emitter
proton.addEmitter(emitter);

//add renderer
proton.addRender(new Proton.SpriteRender(scene));

Building three.proton

Node is a dependency, use terminal to install it with with:
git clone git://github.com/a-jie/three.proton.git
Then navigate to the build directory by running:
cd ./build
Finally run the build command:
node build.js

License

Proton is released under the MIT License. http://www.opensource.org/licenses/mit-license

three.proton's People

Watchers

 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.