How to use the three-nebula.SpriteRenderer function in three-nebula

To help you get started, we’ve selected a few three-nebula examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creativelifeform / three-nebula / website / components / Examples / LifeCycleApi / init.js View on Github external
export default async (three, { scene, camera }) => {
  const system = await ParticleSystem.fromJSONAsync(
    json.particleSystemState,
    three,
    { shouldAutoEmit: false }
  );

  system.addRenderer(new SpriteRenderer(scene, three)).emit({
    onStart: () => feedbackRef.component.setState({ hasStarted: true }),
    onUpdate: () => feedbackRef.component.setState({ isUpdating: true }),
    onEnd: () =>
      feedbackRef.component.setState({ hasEnded: true, isUpdating: false }),
  });

  return system;
};
github creativelifeform / three-nebula / website / components / Examples / MeshZone / init.js View on Github external
export default async (three, { scene, camera }) => {
  THREE = three;
  GLTFLoader = await import('three-gltf-loader');

  const system = new ParticleSystem();
  const mesh = await loadMeshFromGLTF();
  const emitter = await createEmitter(mesh);

  mesh.material.wireframe = true;
  scene.add(mesh);

  return system
    .addEmitter(emitter)
    .addRenderer(new SpriteRenderer(scene, THREE));
};
github creativelifeform / three-nebula / website / components / Examples / SpriteRendererPointZone / init.js View on Github external
export default async (three, { scene, camera }) => {
  THREE = three;

  const system = new ParticleSystem();
  const color1 = new THREE.Color();
  const color2 = new THREE.Color();
  const emitter = createEmitter(color1, color2);

  animate({ color1, color2, emitter, camera, scene });

  return system
    .addEmitter(emitter)
    .addRenderer(new SpriteRenderer(scene, THREE));
};
github creativelifeform / three-nebula / website / components / Examples / SpriteRendererSnow / init.js View on Github external
export default async (three, { scene, camera, renderer }) => {
  THREE = three;

  const system = new ParticleSystem();

  scene.add(createPlane());

  return system
    .addEmitter(createEmitter(camera, renderer))
    .addRenderer(new SpriteRenderer(scene, THREE));
};
github creativelifeform / three-nebula / website / components / Examples / SpriteRendererGravity / init.js View on Github external
export default async (three, { scene, camera }) => {
  THREE = three;

  const system = new ParticleSystem();

  camera.position.z = 500;

  return system
    .addEmitter(createEmitter())
    .addRenderer(new SpriteRenderer(scene, THREE));
};
github creativelifeform / three-nebula / website / components / Examples / EightDiagrams / init.js View on Github external
camera,
    renderer,
  });
  const emitterB = createEmitter({
    colorA: '#004CFE',
    colorB: '#6600FF',
    camera,
    renderer,
  });

  animateEmitters(emitterA, emitterB);

  return system
    .addEmitter(emitterA)
    .addEmitter(emitterB)
    .addRenderer(new SpriteRenderer(scene, THREE));
};