summaryrefslogtreecommitdiff
path: root/assets/javascripts/rectangles/rect.js
diff options
context:
space:
mode:
authorJulie Lala <jules@okfoc.us>2014-04-16 08:51:42 -0400
committerJulie Lala <jules@okfoc.us>2014-04-16 08:51:42 -0400
commit20a7195051b09a6f430fd1dcb6c0d64e86c85d75 (patch)
tree9373586ee53052f50365303799ea223617161d55 /assets/javascripts/rectangles/rect.js
parent20c91d3dae488c653428a465eadeb237eeb8862b (diff)
subtractive surfaces
Diffstat (limited to 'assets/javascripts/rectangles/rect.js')
-rw-r--r--assets/javascripts/rectangles/rect.js43
1 files changed, 22 insertions, 21 deletions
diff --git a/assets/javascripts/rectangles/rect.js b/assets/javascripts/rectangles/rect.js
index a539b74..5f3a211 100644
--- a/assets/javascripts/rectangles/rect.js
+++ b/assets/javascripts/rectangles/rect.js
@@ -180,7 +180,7 @@ window.rect = (function(){
})
return splits
}
-
+
rect.prototype.walls = function(){
var list = [], el = null
@@ -192,7 +192,7 @@ window.rect = (function(){
el = wall('.face.front')
el.width = width
el.height = height
- el.x = this.x.a
+ el.x = this.x.a + width/2
el.z = this.y.a
list.push(el)
}
@@ -201,29 +201,30 @@ window.rect = (function(){
el.width = width
el.height = height
el.rotationY = PI
+ el.x = this.x.b - width/2
+ el.z = this.y.b
+ list.push(el)
+ }
+
+ if (this.sides & LEFT) {
+ el = wall('.face.left')
+ el.rotationY = -HALF_PI
+ el.height = height
+ el.width = depth
el.x = this.x.a
- el.z = this.y.a + depth
+ el.z = this.y.a + depth/2
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)
-// }
+ if (this.sides & RIGHT) {
+ el = wall('.face.right')
+ el.rotationY = HALF_PI
+ el.height = height
+ el.width = depth
+ el.x = this.x.b
+ el.z = this.y.b - depth/2
+ list.push(el)
+ }
function wall(klass){
var el = new MX.Object3D(klass || ".face")