diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-04-03 17:30:37 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-04-03 17:30:37 -0400 |
| commit | 1f4d4c1034f7e3403c9671bd88e6e83d22696dcb (patch) | |
| tree | 9f70ebdf7ce6bd06090803594056ee76b7c84b27 | |
| parent | 66e10f749fcc35e779e2492521b8dd98a8770820 (diff) | |
backface
| -rw-r--r-- | public/assets/javascripts/rectangles/engine/sculpture/types/image.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/public/assets/javascripts/rectangles/engine/sculpture/types/image.js b/public/assets/javascripts/rectangles/engine/sculpture/types/image.js index 9399097..9e8de58 100644 --- a/public/assets/javascripts/rectangles/engine/sculpture/types/image.js +++ b/public/assets/javascripts/rectangles/engine/sculpture/types/image.js @@ -17,7 +17,6 @@ Sculpture.types.image = Sculpture.types.base.extend(function(base){ }, build: function(opt){ - this.footprint = new MX.Object3D() this.mx = new MX.Image({ src: this.media.url, scale: this.scale, @@ -26,9 +25,10 @@ Sculpture.types.image = Sculpture.types.base.extend(function(base){ }) if (opt.position) { - opt.position.y = opt.position.y || this.scale * this.media.height/2 + 5 + opt.position.y = opt.position.y || this.scale * this.media.height/2 + 3 opt.position.rotationY = opt.position.rotationY || scene.camera.rotationY this.billboard = true + this.backface = true } scene.add( this.mx ) @@ -37,6 +37,7 @@ Sculpture.types.image = Sculpture.types.base.extend(function(base){ serialize: function(){ var data = base.serialize.call(this) data.billboard = this.billboard + data.backface = this.backface return data }, @@ -45,6 +46,8 @@ Sculpture.types.image = Sculpture.types.base.extend(function(base){ this.mx.ops.width = data.dimensions.a this.mx.ops.height = data.dimensions.b this.billboard = data.billboard + this.backface = data.backface + if (! this.backface) this.mx.el.classList.remove("backface-visible") this.dimensions.deserialize(data.dimensions) }, } |
