Skip to content

danefilipczak/snowball

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

snowball

A simple to use isosurfacing plugin for Three.js. It calculates the annoying stuff for you and takes care of updating geometry.

Examples [ interactive ]

initializing

new Snowball(vectors, {parameters})

make a new Snowball object with a single THREE.Vector3, or an array of them...

var vectors = []
for (var i = 0; i < 10; i++){
  vectors[i] = new THREE.Vector3(
    Math.random()*10,
    Math.random()*10,
    Math.random()*10
  ); 
};

var snowball = new Snowball(vectors,{
    radius:2,
    isolevel:0.2,
    resolution:20,
    material: new THREE.MeshBasicMaterial({wireframe: true})
  }
 );

... then access its mesh and add it to your scene.

scene.add(snowball.mesh);

All parameters are optional - relatively sensible default values will be calculated if they're left out.

adding vectors

Snowball calculates and updates the size of its voxel field as necessary based on the vectors it's been passed. Add a vector:

snowball.add(new THREE.Vector3(x, y, z));

much more to do. keep in touch with any suggestions/comments. <3 dane

About

easy isosurfacing for Three.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published