Skip to content

Commit

Permalink
Working on Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
TriBlade9 committed Nov 29, 2014
1 parent 2fbb805 commit e9f71ee
Show file tree
Hide file tree
Showing 15 changed files with 403 additions and 113 deletions.
1 change: 0 additions & 1 deletion dist/CEWBS-0.2.3.js

This file was deleted.

11 changes: 5 additions & 6 deletions dist/CEWBS-0.2.3-commonjs.js → dist/CEWBS-0.2.31-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var meshers = {
var CEWBS = {};
CEWBS.Util = require('./helpers/util.js');

CEWBS.version = '0.2.3';
CEWBS.version = '0.2.31';

CEWBS.VoxelMesh = function(name, scene) {
BABYLON.Mesh.call(this, name, scene);
Expand Down Expand Up @@ -217,15 +217,14 @@ CEWBS.VoxelMesh.prototype.importZoxel = function(zoxelData) {
var cewbsData = {};
cewbsData.dimensions = [zoxelData.width, zoxelData.height, zoxelData.depth];

cewbsData.voxels = zoxelData.frame1;
cewbsData.voxels = JSON.parse(JSON.stringify(zoxelData.frame1));

for(var i = 0; i < cewbsData.voxels.length; i++) {
cewbsData.voxels[i][4] = cewbsData.voxels[i][3];
cewbsData.voxels[i][3] = parseInt(cewbsData.voxels[i][3].toString(16).substring(0,6), 16);
cewbsData.voxels[i][3] = cewbsData.voxels[i][3]/100;
}

this.coloringFunction = function(id, meta) {
return CEWBS.Util.hex2rgb(meta.toString(16));
this.coloringFunction = function(id) {
return CEWBS.Util.hex2rgb((id*100).toString(16));
}

this.setDimensions(cewbsData.dimensions);
Expand Down
11 changes: 5 additions & 6 deletions dist/CEWBS-0.2.3-debug.js → dist/CEWBS-0.2.31-debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var meshers = {
var CEWBS = window.CEWBS = {};
CEWBS.Util = require('./helpers/util.js');

CEWBS.version = '0.2.3';
CEWBS.version = '0.2.31';

CEWBS.VoxelMesh = function(name, scene) {
BABYLON.Mesh.call(this, name, scene);
Expand Down Expand Up @@ -218,15 +218,14 @@ CEWBS.VoxelMesh.prototype.importZoxel = function(zoxelData) {
var cewbsData = {};
cewbsData.dimensions = [zoxelData.width, zoxelData.height, zoxelData.depth];

cewbsData.voxels = zoxelData.frame1;
cewbsData.voxels = JSON.parse(JSON.stringify(zoxelData.frame1));

for(var i = 0; i < cewbsData.voxels.length; i++) {
cewbsData.voxels[i][4] = cewbsData.voxels[i][3];
cewbsData.voxels[i][3] = parseInt(cewbsData.voxels[i][3].toString(16).substring(0,6), 16);
cewbsData.voxels[i][3] = cewbsData.voxels[i][3]/100;
}

this.coloringFunction = function(id, meta) {
return CEWBS.Util.hex2rgb(meta.toString(16));
this.coloringFunction = function(id) {
return CEWBS.Util.hex2rgb((id*100).toString(16));
}

this.setDimensions(cewbsData.dimensions);
Expand Down
1 change: 1 addition & 0 deletions dist/CEWBS-0.2.31.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example/assets/body.zox

Large diffs are not rendered by default.

Loading

0 comments on commit e9f71ee

Please sign in to comment.