All Projects → creativelifeform → Three Nebula

creativelifeform / Three Nebula

Licence: mit
WebGL based particle system engine for three.js

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Three Nebula

Partykals
Particles system library for THREE.js
Stars: ✭ 109 (-43.23%)
Mutual labels:  webgl, threejs, particles
Three.phenomenon
⭐️ A tiny wrapper around three.js built for high-performance WebGL experiences.
Stars: ✭ 338 (+76.04%)
Mutual labels:  webgl, threejs, particles
Texture Compressor
CLI tool for texture compression using ASTC, ETC, PVRTC and S3TC in a KTX container.
Stars: ✭ 156 (-18.75%)
Mutual labels:  webgl, threejs
Stickyimageeffect
A sticky image effect for a slideshow inspired by ultanoir's website.
Stars: ✭ 158 (-17.71%)
Mutual labels:  webgl, threejs
Vue Displacement Slideshow
A Vue.js 2.0 slideshow component working with Three.js
Stars: ✭ 165 (-14.06%)
Mutual labels:  webgl, threejs
Interactivelandscape
An exploration of an animated interactive landscape built with three.js.
Stars: ✭ 150 (-21.87%)
Mutual labels:  webgl, threejs
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (-20.83%)
Mutual labels:  webgl, threejs
Patches
Patches is a visual programming editor for building WebVR and WebGL experiences.
Stars: ✭ 164 (-14.58%)
Mutual labels:  webgl, threejs
Andromeda
This is a WebGL recreation of the popular music video Gorillaz - Andromeda.
Stars: ✭ 145 (-24.48%)
Mutual labels:  webgl, threejs
React Globe
Create beautiful and interactive React + ThreeJS globe visualizations with ease.
Stars: ✭ 167 (-13.02%)
Mutual labels:  webgl, threejs
Threejs Path Flow
🐬🐟 ↶Mesh Deformation / Bending / Following on a Curve
Stars: ✭ 165 (-14.06%)
Mutual labels:  webgl, threejs
Expo Voxel
🎮🌳 Voxel Terrain made in React Native. ∛
Stars: ✭ 169 (-11.98%)
Mutual labels:  webgl, threejs
Geo Three
Tile based geographic world map visualization library for threejs
Stars: ✭ 146 (-23.96%)
Mutual labels:  webgl, threejs
Antipasto
🍽 Juicy starter for three.js
Stars: ✭ 147 (-23.44%)
Mutual labels:  webgl, threejs
Proton
Javascript particle animation library
Stars: ✭ 1,958 (+919.79%)
Mutual labels:  webgl, particles
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: ✭ 2,042 (+963.54%)
Mutual labels:  webgl, threejs
Layaair discard
This is old LayaAir veriosn writetten by ActionScript 3.0 ,now LayaAir is using TypeScript as the Engine Script,Please use https://github.com/layabox/LayaAir instead.
Stars: ✭ 1,858 (+867.71%)
Mutual labels:  webgl, particles
Threejs Modern App
Boilerplate and utils for a fullscreen Three.js app
Stars: ✭ 176 (-8.33%)
Mutual labels:  webgl, threejs
Ego
A lightweight decision making library for game AI.
Stars: ✭ 145 (-24.48%)
Mutual labels:  webgl, threejs
Ng Three Template
This is a basic template project to start with Angular 11.x and ThreeJS
Stars: ✭ 144 (-25%)
Mutual labels:  webgl, threejs

react-router

    three-nebula

    WebGL based 3D particle system engine for three

    


CHANGELOG

Three Nebula is a WebGL based 3D particle engine that has been designed to work alongside three.js. Check out the website, examples, the quickstart sandbox and API reference documentation for more.

Features

  • Perfect compatibility with [email protected]
  • The ability to instantiate three-nebula particle systems from JSON objects
  • The ability to create particle systems from sprites as well as 3D meshes
  • Many kinds of particle behaviours and initializers

Installation

npm

npm i --save three-nebula

script

<script type='text/javascript' src='node_modules/three-nebula/build/three-nebula.js'></script>

Usage

Module

import System, {
  Emitter,
  Rate,
  Span,
  Position,
  Mass,
  Radius,
  Life,
  Velocity,
  PointZone,
  Vector3D,
  Alpha,
  Scale,
  Color,
} from 'three-nebula';
import * as THREE from 'three';

const system = new System();
const emitter = new Emitter();
const renderer = new SpriteRenderer(threeScene, THREE);

// Set emitter rate (particles per second) as well as the particle initializers and behaviours
emitter
  .setRate(new Rate(new Span(4, 16), new Span(0.01)))
  .setInitializers([
    new Position(new PointZone(0, 0)),
    new Mass(1),
    new Radius(6, 12),
    new Life(3),
    new RadialVelocity(45, new Vector3D(0, 1, 0), 180),
  ])
  .setBehaviours([
    new Alpha(1, 0),
    new Scale(0.1, 1.3),
    new Color(new THREE.Color(), new THREE.Color()),
  ]);

// add the emitter and a renderer to your particle system
system
  .addEmitter(emitter)
  .addRenderer(renderer)
  .emit({ onStart, onUpdate, onEnd });

You can also instantiate your system from a JSON object

import System from 'three-nebula';

const json = {
  preParticles: 500,
  integrationType: 'euler',
  emitters: [
    {
      rate: {
        particlesMin: 5,
        particlesMax: 7,
        perSecondMin: 0.01,
        perSecondMax: 0.02,
      },
      position: {
        x: 70,
        y: 0,
      },
      initializers: [
        {
          type: 'Mass',
          properties: {
            min: 1,
            max: 1,
          },
        },
        {
          type: 'Life',
          properties: {
            min: 2,
            max: 2,
          },
        },
        {
          type: 'BodySprite',
          properties: {
            texture: './img/dot.png',
          },
        },
        {
          type: 'Radius',
          properties: {
            width: 80,
            height: 80,
          },
        },
      ],
      behaviours: [
        {
          type: 'Alpha',
          properties: {
            alphaA: 1,
            alphaB: 0,
          },
        },
        {
          type: 'Color',
          properties: {
            colorA: '#4F1500',
            colorB: '#0029FF',
          },
        },
        {
          type: 'Scale',
          properties: {
            scaleA: 1,
            scaleB: 0.5,
          },
        },
        {
          type: 'Force',
          properties: {
            fx: 0,
            fy: 0,
            fz: -20,
          },
        },
      ],
    },
    {
      rate: {
        particlesMin: 5,
        particlesMax: 7,
        perSecondMin: 0.01,
        perSecondMax: 0.02,
      },
      position: {
        x: -70,
        y: 0,
      },
      initializers: [
        {
          type: 'Mass',
          properties: {
            min: 1,
            max: 1,
          },
        },
        {
          type: 'Life',
          properties: {
            min: 2,
            max: 2,
          },
        },
        {
          type: 'BodySprite',
          properties: {
            texture: './img/dot.png',
          },
        },
        {
          type: 'Radius',
          properties: {
            width: 80,
            height: 80,
          },
        },
      ],
      behaviours: [
        {
          type: 'Alpha',
          properties: {
            alphaA: 1,
            alphaB: 0,
          },
        },
        {
          type: 'Color',
          properties: {
            colorA: '#004CFE',
            colorB: '#6600FF',
          },
        },
        {
          type: 'Scale',
          properties: {
            scaleA: 1,
            scaleB: 0.5,
          },
        },
        {
          type: 'Force',
          properties: {
            fx: 0,
            fy: 0,
            fz: -20,
          },
        },
      ],
    },
  ],
};

new System.fromJSONAsync(json, THREE).then(system => {
  console.log(system);
});

Script Tag

If you are adding three-nebula to your project in the script tag, the only difference to the above example is how you access the classes you need. You can do that like so

const { System, Emitter, Rate, Span } = window.Nebula;
const system = new System();

Development

Sandbox

The sandbox located in ./sandbox contains a kind of plain JavaScript bootstrapping framework for testing and experimenting with library changes. The experiments in here are not permanent and will get updated/added/removed from time to time.

Because of the visual and graphical nature of the library it is sometimes very helpful to have simple barebones examples that allow you to dig into the root cause of an issue or try new things out.

The sandbox can easily be run via

npm run sandbox

This will serve the sandbox at http://localhost:5000 and you can checkout the various experiments in the browser. It will also auto rebuild the library code and push the rebuilt bundle to the sandbox so all you need to do in order to see your changes is to refresh the browser.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].