Skip to content

A small collection of threejs libraries, including my own and those from other sources.

Notifications You must be signed in to change notification settings

christopherjbaker/threejs-libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Three.JS Libraries by HMU

This is a small collection of threejs libraries, including my own and third party dependencies. All the examples can be seen live at gh-pages.

World

This is the base of my libraries (though not all require it). All the examples use this. It can be used directly (as in the emitter example) or as a base class (as in the animator example).

Utils

Provides:

  • HMU.Option(base, spread) - Constructor for repeatedly generating random values in a range.
  • HMU.utils.randomVector3(base, spread) - Returns a random THREE.Vector3 in [base - spread / 2, base + spread / 2].
  • HMU.utils.randomEuler(base, spread) - Returns a random THREE.Euler in [base - spread / 2, base + spread / 2].
  • HMU.utils.randomColor(base, spread) - Returns a random THREE.Color in [base - spread / 2, base + spread / 2].
  • HMU.utils.randomFloat(base, spread) - Returns a random Number in [base - spread / 2, base + spread / 2].

Utils.Geometry

Provides:

  • HMU.utils.CylinderGeometryUV(geometry) - Generates a UV layout for the given THREE.Geometry, generated by THREE.CylinderGeometry.

Animator

The animator library can be used standalone. The usage is fairly straight-forward and can be seen in the animator example.

Provides:

  • HMU.Animator() - Constructor for an animations manager.
  • HMU.Animation(object, property, config) - Constructor for an individual animation. (Probably won't need directly.)
  • HMU.Easing.*(time, base, change, duration) - a subset of Robert Penner's Easing Equations. Extend to provide more easing options to HMU.Animation.

Emitter

The emitter library depends on HMU.Option, provided by Utils. The easiest way to see how it works is to play with the emitter example.

Provides:

  • HMU.Emitter(options) - Constructor for managing an object emitter.

Perlin

The perlin library can be used standalone. The usage is fairly straight-forward and can be seen in the perlin example. It is an early beta and has not been optimized.

Provides:

  • HMU.Perlin(input) - Returns the scalar value for a given THREE.Vector3.
  • HMU.Perlin.gradient(input) - Returns the gradient for a given THREE.Vector3, after rounding.

Private:

  • HMU.Perlin.gradient.fp(input)
  • HMU.Perlin.gradient.fgx(input)
  • HMU.Perlin.gradient.fgy(input)
  • HMU.Perlin.gradient.fgz(input)

Swarm

The swarm library is only a skeleton, and currently has no usable code. When complete, it should be usable standalone, however.

Provides:

  • HMU.Swarm - Constructor for managing a swarm of HMU.Drones.
  • HMU.Drone - An individual unit of an HMU.Swarm.

About

A small collection of threejs libraries, including my own and those from other sources.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published