Skip to content

Commit

Permalink
Added .grid
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchirls committed Sep 14, 2015
1 parent c800afb commit 30a89b5
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 36 deletions.
44 changes: 25 additions & 19 deletions build/vr.dev.js

Large diffs are not rendered by default.

31 changes: 16 additions & 15 deletions build/vr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/vr.js.map

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions src/objects/grid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = (function () {
'use strict';

var THREE = require('three');

return function box(parent, options) {
var obj,
size = options && options.size || 10,
step = options && options.step || 1;

obj = new THREE.GridHelper(size, step);
obj.name = 'grid';
if (options) {
obj.setColors(options.colorCenterLine || obj.color1, options.colorGrid || obj.color2);
}
obj.geometry.computeBoundingBox();

parent.add(obj);

return obj;
};
}());
3 changes: 2 additions & 1 deletion src/vr.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
'panorama',
'image',
'video',
'text'
'text',
'grid'
],

//todo: use a weak map or set instead
Expand Down

0 comments on commit 30a89b5

Please sign in to comment.