Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
284b03e5
Commit
284b03e5
authored
May 05, 2017
by
amandaghassaei
Browse files
3d selection
parent
4e623506
Changes
3
Hide whitespace changes
Inline
Side-by-side
js/3dUI.js
View file @
284b03e5
...
...
@@ -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
();
...
...
js/model.js
View file @
284b03e5
...
...
@@ -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
]);
...
...
js/node.js
View file @
284b03e5
...
...
@@ -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
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment