Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 2.03 KB

README.md

File metadata and controls

65 lines (46 loc) · 2.03 KB

Babylon Voxel Critter

Voxel critter for Babylon.js

Critter for Babylon.js.

Best when used with Noa-Engine.

Example

// Create from image
let scale = 0.2;
let rotation = new BABYLON.Vector3(0, Math.PI/2, 0);
let imported_mesh;
let eid;

CritterCreator.create_mesh_from_image('./rabbit.png', scale, function(mesh){
	imported_mesh = mesh;
	mesh.rotation = rotation;
	// Add mesh to the world
	eid = noa.entities.add([-1, 1.8, 7], 1, 0.5, imported_mesh, [0,0,0], false, false);
});

////////////////////////////////////
////////////////////////////////////

// Create from hash
let hash = "C/2ecc713498db34495ee67e22ecf0f1000000de8787ff0000:A/bfhkSfdihfShaefShahfShahhYfYfYfSfSfSfYhYhYhahjSdechjYhYhYhadfQUhchfYhYhSfYdQYhYhaefQYhYhYhYhSjcchQYhYhYhYhSfSfWehSfUhShecheQYhYhYhYhachYhYhafhYhahfShXdfhShcihYaVhfYmfbihhQYhYhYhaddQShahfYhYhYhShYfYfYfafhQUhchfYhYhYhShechdUhUhcheUhUhcheUhUhcheUhUhcheUhUhWehUhUhcfeUhUhcfeUhUhcfeUhUhcfeUhUhehehUhUhcheUhUhcheUhUhcheUhUhWehUhUhcfeUhUhcfeUhUhcfeUhUhcfeUiWffUhWheQYhYhYhYhachQYiYhYhShYfYfYfYfShYhYhYhYhadeakiQSfSfSfUfShShShUfSfSfSfUfShShShUfSfSfSfcakQShShWfeQShShWeeQUhWfhUhShUfWjhQUfUfUfWfdQShShShWkhQUfUfUfchjQYhYhYhYhUfYfYdYhUfYhYhcifQYfYfYfYeQcffQYhYlYfcdhckjUfUfeejeYhYcYhcfhYhcfhYhcifYhcfhYhcfhYhYcYhfjaijacfShcjeYfYfUfYifblfeUfcfhUhcpeUhYhUhebeh";
let scale = 0.2;
let rotation = new BABYLON.Vector3(0, Math.PI/2, 0);
let imported_mesh;
let eid;

CritterCreator.create_mesh_from_hash(hash, scale, function(mesh){
	imported_mesh = mesh;
	mesh.rotation = rotation;
	// Add mesh to the world
	eid = noa.entities.add([-3, 2, -1], 1, 0.5, imported_mesh, [0,0,0], false, false);
});

Run the Example

  1. git clone git://github.com/Nesh108/babylon-voxel-critter && cd babylon-voxel-critter
  2. npm install
  3. npm start

Install

With npm do:

npm install --save babylon-voxel-critter

Release History

  • 1.0.0 - initial release

License

Copyright (c) 2017 Nesh108

Licensed under the MIT license.