From 90142bd07f926ef8a7f3ea86a563ec0ca648ca5d Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 3 Jun 2014 17:51:34 -0400 Subject: pulling in more stuff from posthang --- .../environments/tableaux/columns_circle.js | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 public/assets/javascripts/environments/tableaux/columns_circle.js (limited to 'public/assets/javascripts/environments/tableaux/columns_circle.js') diff --git a/public/assets/javascripts/environments/tableaux/columns_circle.js b/public/assets/javascripts/environments/tableaux/columns_circle.js new file mode 100644 index 0000000..1816e51 --- /dev/null +++ b/public/assets/javascripts/environments/tableaux/columns_circle.js @@ -0,0 +1,42 @@ +MX.Tableaux.ColumnsCircle = MX.Tableau.extend({ + + init: function (opt) { + + this.opt = opt = defaults(opt, { + width: 10, + height: 10, + depth: 10, + radius: 10, + theta: 0, + skip: 0, + x: 0, + y: 0, + z: 0, + rotationY: 0, + rotationX: 0, + scale: 1, + count: 3, + }) + + var scalebox, theta + var radius = opt.radius + + for (var i = opt.skip; i < opt.count; i++) { + theta = i/opt.count * TWO_PI + opt.theta + scalebox = new MX.ScaleBox({ + "width": opt.width, + "height": opt.height, + "depth": opt.depth, + "x": opt.x + sin(theta) * radius, + "y": opt.y, + "z": opt.z + cos(theta) * radius, + "rotationY": PI - theta, + "color": opt.color, + "sides": "top bottom left right front back" + }); + scene.add(scalebox) + } + + } + +}) -- cgit v1.2.3-70-g09d2