summaryrefslogtreecommitdiff
path: root/assets/javascripts/rectangles/rect.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-04-15 19:12:16 -0400
committerJules Laplace <jules@okfoc.us>2014-04-15 19:12:16 -0400
commit9c3c0151cb2b0a824f184501ea2672ef9e87a993 (patch)
tree44591f45911a0078f15202cdaf21d03aa5945301 /assets/javascripts/rectangles/rect.js
parent3d4a9829797f850fde2b65afbaa4dc45f519c3eb (diff)
positioning sides (half done)
Diffstat (limited to 'assets/javascripts/rectangles/rect.js')
-rw-r--r--assets/javascripts/rectangles/rect.js56
1 files changed, 27 insertions, 29 deletions
diff --git a/assets/javascripts/rectangles/rect.js b/assets/javascripts/rectangles/rect.js
index 67abdee..3c6eedc 100644
--- a/assets/javascripts/rectangles/rect.js
+++ b/assets/javascripts/rectangles/rect.js
@@ -186,52 +186,50 @@ window.rect = (function(){
var width = this.x.length()
var depth = this.y.length()
- var height = 800
+ var height = 500
if (this.sides & FRONT) {
el = wall('.face.front')
- el.scaleX = width
- el.scaleY = height
- el.z = this.y.a - depth/2
+ el.width = width
+ el.height = height
el.x = this.x.a
- el.y = height/2
- list.push(el)
- }
- if (this.sides & LEFT) {
- el = wall('.face.left')
- el.rotationY = -HALF_PI
- el.scaleY = height
- el.scaleZ = depth
- el.x = this.x.a - width/2
- el.z = this.y.a
- el.y = height/2
- list.push(el)
- }
- if (this.sides & RIGHT) {
- el = wall('.face.right')
- el.rotationY = HALF_PI
- el.scaleY = height
- el.scaleZ = depth
- el.x = this.x.a + width/2
- el.y = height/2
el.z = this.y.a
list.push(el)
}
if (this.sides & BACK) {
var el = wall('.face.back')
- el.scaleX = width
- el.scaleY = height
+ el.width = width
+ el.height = height
el.rotationY = PI
- el.z = this.y.a + depth/2
- el.y = height/2
el.x = this.x.a
+ el.z = this.y.a + depth
list.push(el)
}
-
+
+// if (this.sides & LEFT) {
+// el = wall('.face.left')
+// el.rotationY = -HALF_PI
+// el.height = height
+// el.width = depth
+// el.z = this.y.a - depth/2
+// el.x = this.x.a
+// list.push(el)
+// }
+// if (this.sides & RIGHT) {
+// el = wall('.face.right')
+// el.rotationY = HALF_PI
+// el.height = height
+// el.width = depth
+// el.z = this.y.a - depth/2
+// el.x = this.x.b
+// list.push(el)
+// }
+
function wall(klass){
var el = new MX.Object3D(klass || ".face")
el.width = el.height = el.scaleX = el.scaleY = el.scaleZ = 1
el.z = el.y = el.x = 0
+ el.y = height/2
el.type = "Face"
return el
}