Skip to content
Snippets Groups Projects
Commit 53529de3 authored by Amanda Ghassaei's avatar Amanda Ghassaei
Browse files

normal added

parent a4e34dd4
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,8 @@ PushPullMeshView = Backbone.View.extend({
},
drawBounds: function(){
this.boundsBox = new THREE.Mesh(new THREE.BoxGeometry(100, 100, 100), new THREE.MeshLambertMaterial({color:0x0000ff, shading:THREE.FlatShading, transparent:true, opacity:0.0, vertexColors:THREE.FaceColors}));
this.boundsBox = new THREE.Mesh(new THREE.BoxGeometry(100, 100, 100),
new THREE.MeshLambertMaterial({color:0x0000ff, shading:THREE.FlatShading, transparent:true, opacity:0.0, vertexColors:THREE.FaceColors}));
this.boxHelper = new THREE.BoxHelper(this.boundsBox);
this.boxHelper.material.color.set(this.defaultColor);
......
......@@ -16,6 +16,7 @@ ThreeView = Backbone.View.extend({
highlightTargets: null,
meshHandle: null,
cubeGeometry: new THREE.BoxGeometry(5,5,5),
cubeMaterial: new THREE.MeshLambertMaterial({color:0x0000ff, shading:THREE.FlatShading, vertexColors:THREE.FaceColors}),
el: "#threeContainer",
......@@ -58,6 +59,7 @@ ThreeView = Backbone.View.extend({
if (intersections.length>1){
var voxel = new THREE.Mesh(this.cubeGeometry);
voxel.position.copy(intersections[1].point);
if (intersections[1].face) voxel.position.add(intersections[1].face.normal);
voxel.position.divideScalar(5).floor().multiplyScalar(5).addScalar(2.5);
this.model.sceneAdd(voxel);
this.model.render();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment