Commit b66aa0c3 authored by amandaghassaei's avatar amandaghassaei

user interaction fixes

parent c635e189
......@@ -100,11 +100,11 @@ function init3DUI(globals) {
if (intersections.length>0){
var face = intersections[0].face;
var position = intersections[0].point;
var verticesArray = globals.model.getVertices();
var positionsArray = globals.model.getPositionsArray();
var vertices = [];
vertices.push(verticesArray[face.a]);
vertices.push(verticesArray[face.b]);
vertices.push(verticesArray[face.c]);
vertices.push(new THREE.Vector3(positionsArray[3*face.a], positionsArray[3*face.a+1], positionsArray[3*face.a+2]));
vertices.push(new THREE.Vector3(positionsArray[3*face.b], positionsArray[3*face.b+1], positionsArray[3*face.b+2]));
vertices.push(new THREE.Vector3(positionsArray[3*face.c], positionsArray[3*face.c+1], positionsArray[3*face.c+2]));
var dist = vertices[0].clone().sub(position).lengthSq();
var nodeIndex = face.a;
for (var i=1;i<3;i++){
......
......@@ -255,11 +255,11 @@ function initViveInterface(globals){
continue;
}
var verticesArray = globals.model.getVertices();
var positionsArray = globals.model.getPositionsArray();
var vertices = [];
vertices.push(verticesArray[face.a]);
vertices.push(verticesArray[face.b]);
vertices.push(verticesArray[face.c]);
vertices.push(new THREE.Vector3(positionsArray[3*face.a], positionsArray[3*face.a+1], positionsArray[3*face.a+2]));
vertices.push(new THREE.Vector3(positionsArray[3*face.b], positionsArray[3*face.b+1], positionsArray[3*face.b+2]));
vertices.push(new THREE.Vector3(positionsArray[3*face.c], positionsArray[3*face.c+1], positionsArray[3*face.c+2]));
var dist = transformToGlobalCoords(vertices[0].clone()).sub(point).lengthSq();
var nodeIndex = face.a;
for (var j=1;j<3;j++){
......
......@@ -147,10 +147,6 @@ function initModel(globals){
return [frontside, backside];
}
function getVertices(){
return vertices;
}
function getPositionsArray(){
return positions;
}
......@@ -409,7 +405,6 @@ function initModel(globals){
getFaces: getFaces,
getCreases: getCreases,
getGeometry: getGeometry,//for save stl
getVertices: getVertices,//for user interaction, vive interface
getPositionsArray: getPositionsArray,
getColorsArray: getColorsArray,
getMesh: getMesh,
......
Markdown is supported
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