Skip to content

An Javascript library that allows you to control animal motion such as bird flock and fish school .

Notifications You must be signed in to change notification settings

spankiejoe/boids.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

boids.js

This library provides a api that allow you to control animal motion such as bird flock and fish school.

Usage

Here is a very basic example.

<script src="http://after12am.github.com/boids.js/boids.js"></script>
<script>

window.onload = function() {

  var v = new boids.SteeredVehicle( -200, 0, 0 );
  var target = new boids.Vector3( 200, 0, 0 );

  function animate() {
    
    setTimeout(animate, 1000 / 30);
    update();
  }

  function update() {

    v.seek(target);
    v.update();
    console.log(v.position.x, v.position.y, v.position.z);
  }

  animate();
}
  
</script>

About

An Javascript library that allows you to control animal motion such as bird flock and fish school .

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.1%
  • Python 5.9%