summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/environments/tableaux/columns_circle.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/javascripts/environments/tableaux/columns_circle.js')
-rw-r--r--public/assets/javascripts/environments/tableaux/columns_circle.js42
1 files changed, 42 insertions, 0 deletions
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)
+ }
+
+ }
+
+})