Commit 284b03e5 authored by amandaghassaei's avatar amandaghassaei
Browse files

3d selection

parent 4e623506
......@@ -13,8 +13,7 @@ function init3DUI(globals) {
var draggingNodeFixed = false;
var mouseDown = false;
var highlightedObj;
$(document).dblclick(function() {
});
......@@ -71,19 +70,9 @@ function init3DUI(globals) {
return intersection;
}
// function getPointOfIntersectionWithObject(object){
// var intersections = raycaster.intersectObjects([object], false);
// if (intersections.length > 0) {
// return intersections[0].point;
// }
// console.warn("no intersection found");
// return null;
// }
function setHighlightedObj(object){
if (highlightedObj && (object != highlightedObj)) {
highlightedObj.unhighlight();
// globals.controls.hideMoreInfo();
}
highlightedObj = object;
if (highlightedObj) highlightedObj.highlight();
......
......@@ -307,12 +307,18 @@ function initModel(globals){
var scale = 100/geometry.boundingSphere.radius;
globals.scale = scale;
globals.threeView.setScale(scale);
object3D.geometry.dispose();
object3D.geometry = geometry;
object3D2.geometry = geometry;
for (var i=0;i<positions.length;i++){
positions[i] *= scale;
}
for (var i=0;i<vertices.length;i++){
vertices[i].multiplyScalar(scale, scale, scale);
}
//update vertices
for (var i=0;i<vertices.length;i++){
nodes[i].setOriginalPosition(positions[3*i], positions[3*i+1], positions[3*i+2]);
......
......@@ -72,21 +72,6 @@ Node.prototype.getExternalForce = function(){
return this.externalForce.getForce();
};
Node.prototype.getLocalLength = function(){
var length = 0;
_.each(this.beams, function(beam){
length += beam.getLength(true)/2;
});
return length;
};
Node.prototype.getMass = function(){
return globals.density*this.getLocalLength();
};
Node.prototype.addCrease = function(crease){
this.creases.push(crease);
};
......@@ -145,10 +130,6 @@ Node.prototype.getObject3D = function(){
return this.object3D;
};
Node.prototype.setDeleteMode = function(){
this.object3D.material = nodeMaterialDelete;
};
Node.prototype.highlight = function(){
this.object3D.material = nodeMaterialHighlight;
};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment