summaryrefslogtreecommitdiff
path: root/client/assets/javascripts/environments
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-06-03 16:24:10 -0400
committerJules Laplace <jules@okfoc.us>2014-06-03 16:24:28 -0400
commit607f69c67a5b4dc72d2754192e3cdf67d0ad11d0 (patch)
tree6556e7922c5bedb274bb1650e5dd100643a7895d /client/assets/javascripts/environments
parentd31259291d807c851de4396921e0c26b6dd8dce2 (diff)
partitioning client and serveR
Diffstat (limited to 'client/assets/javascripts/environments')
-rw-r--r--client/assets/javascripts/environments/app.js28
-rw-r--r--client/assets/javascripts/environments/tableaux/_empty.js32
-rw-r--r--client/assets/javascripts/environments/tableaux/columns.js36
-rw-r--r--client/assets/javascripts/environments/tableaux/columns_circle.js42
-rw-r--r--client/assets/javascripts/environments/tableaux/columns_split.js63
5 files changed, 201 insertions, 0 deletions
diff --git a/client/assets/javascripts/environments/app.js b/client/assets/javascripts/environments/app.js
new file mode 100644
index 0000000..cdc104b
--- /dev/null
+++ b/client/assets/javascripts/environments/app.js
@@ -0,0 +1,28 @@
+var scrubber, fish, floor
+
+var environment = new function(){}
+environment.init = function(){
+
+ scene.camera.move({
+ "x": 0,
+ "y": 0,
+ "z": 0,
+ "rotationX": 0.085,
+ "rotationY": 0.025
+ })
+ map && map.zoom(3.00) && map.recenter()
+
+ //
+ // intro floor, models, etc
+
+}
+
+
+environment.update = function(t){
+
+ // add continuous animations and stuff here
+
+ map && map.update()
+
+}
+
diff --git a/client/assets/javascripts/environments/tableaux/_empty.js b/client/assets/javascripts/environments/tableaux/_empty.js
new file mode 100644
index 0000000..b69fa78
--- /dev/null
+++ b/client/assets/javascripts/environments/tableaux/_empty.js
@@ -0,0 +1,32 @@
+/*
+
+MX.Tableaux.Foo = MX.Tableau.extend({
+
+ init: function (opt) {
+
+ this.opt = opt = defaults(opt, {
+ width: 100,
+ height: 100,
+ depth: 100,
+ x: 0,
+ y: 0,
+ z: 0,
+ rotationY: 0,
+ rotationX: 0,
+ scale: 1,
+ })
+
+ },
+
+ animate: function() {
+ },
+
+ show: function(){
+ },
+
+ hide: function(){
+ },
+
+})
+
+*/
diff --git a/client/assets/javascripts/environments/tableaux/columns.js b/client/assets/javascripts/environments/tableaux/columns.js
new file mode 100644
index 0000000..e961315
--- /dev/null
+++ b/client/assets/javascripts/environments/tableaux/columns.js
@@ -0,0 +1,36 @@
+MX.Tableaux.Columns = MX.Tableau.extend({
+
+ init: function (opt) {
+
+ this.opt = opt = defaults(opt, {
+ width: 10,
+ height: 10,
+ depth: 10,
+ x: 0,
+ y: 0,
+ z: 0,
+ rotationY: 0,
+ rotationX: 0,
+ scale: 1,
+ count: 3,
+ spacingX: 0,
+ spacingZ: 100,
+ })
+
+ for (var i = 0; i < opt.count; i++) {
+ var scalebox = new MX.ScaleBox({
+ "width": opt.width,
+ "height": opt.height,
+ "depth": opt.depth,
+ "x": opt.x + opt.spacingX * i,
+ "y": opt.y,
+ "z": opt.z + opt.spacingZ * i,
+ "color": opt.color,
+ "sides": "top bottom left right front back"
+ });
+ scene.add(scalebox)
+ }
+
+ }
+
+})
diff --git a/client/assets/javascripts/environments/tableaux/columns_circle.js b/client/assets/javascripts/environments/tableaux/columns_circle.js
new file mode 100644
index 0000000..1816e51
--- /dev/null
+++ b/client/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)
+ }
+
+ }
+
+})
diff --git a/client/assets/javascripts/environments/tableaux/columns_split.js b/client/assets/javascripts/environments/tableaux/columns_split.js
new file mode 100644
index 0000000..b9981d6
--- /dev/null
+++ b/client/assets/javascripts/environments/tableaux/columns_split.js
@@ -0,0 +1,63 @@
+MX.Tableaux.ColumnsSplit = MX.Tableau.extend({
+
+ init: function (opt) {
+
+ this.opt = opt = defaults(opt, {
+ width: 100,
+ height: 100,
+ depth: 100,
+ norm: 0.5,
+ gap: 5,
+ x: 0,
+ y: 0,
+ z: 0,
+ rotationY: 0,
+ scale: 1,
+ count: 1,
+ })
+
+ opt.colorBottom = opt.colorBottom || opt.color
+
+ if ( ! (opt.norm instanceof Array) ) {
+ opt.norm = [ opt.norm, opt.norm ]
+ }
+
+ var norm, spacingX, spacingZ, scalebox
+
+ for (var i = 0; i < opt.count; i++) {
+
+ norm = lerp( i/(opt.count-1), opt.norm[0], opt.norm[1] )
+
+ spacingX = opt.spacingX * i
+ spacingZ = opt.spacingZ * i
+
+ scalebox = new MX.ScaleBox({
+ "width": opt.width,
+ "height": opt.height * norm,
+ "depth": opt.depth,
+ "x": opt.x + spacingX,
+ "y": opt.y + opt.gap,
+ "z": opt.z + spacingZ,
+ "color": opt.color,
+ "sides": "top bottom left right front back",
+ "rotationY": opt.rotationY,
+ });
+ scene.add(scalebox)
+
+ scalebox = new MX.ScaleBox({
+ "width": opt.width,
+ "height": opt.height * (1 - norm),
+ "depth": opt.depth,
+ "x": opt.x + spacingX,
+ "y": opt.y - opt.height * (1 - norm) - opt.gap,
+ "z": opt.z + spacingZ,
+ "color": opt.colorBottom,
+ "sides": "top bottom left right front back",
+ "rotationY": opt.rotationY,
+ });
+ scene.add(scalebox)
+ }
+
+ }
+
+})