Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
f4a1591a
Commit
f4a1591a
authored
May 05, 2017
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show 3D cursor
parent
d2587d80
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
js/3dUI.js
js/3dUI.js
+14
-1
js/node.js
js/node.js
+6
-1
No files found.
js/3dUI.js
View file @
f4a1591a
...
...
@@ -14,6 +14,10 @@ function init3DUI(globals) {
var
mouseDown
=
false
;
var
highlightedObj
;
var
highlighter1
=
new
Node
(
new
THREE
.
Vector3
());
highlighter1
.
setTransparent
();
globals
.
threeView
.
scene
.
add
(
highlighter1
.
getObject3D
());
$
(
document
).
dblclick
(
function
()
{
});
...
...
@@ -61,6 +65,11 @@ function init3DUI(globals) {
highlightedObj
.
moveManually
(
intersection
);
globals
.
nodePositionHasChanged
=
true
;
}
if
(
highlightedObj
){
var
position
=
highlightedObj
.
getPosition
();
highlighter1
.
getObject3D
().
position
.
set
(
position
.
x
,
position
.
y
,
position
.
z
);
}
}
function
getIntersectionWithObjectPlane
(
position
){
...
...
@@ -75,9 +84,13 @@ function init3DUI(globals) {
function
setHighlightedObj
(
object
){
if
(
highlightedObj
&&
(
object
!=
highlightedObj
))
{
highlightedObj
.
unhighlight
();
highlighter1
.
getObject3D
().
visible
=
false
;
}
highlightedObj
=
object
;
if
(
highlightedObj
)
highlightedObj
.
highlight
();
if
(
highlightedObj
)
{
highlightedObj
.
highlight
();
highlighter1
.
getObject3D
().
visible
=
true
;
}
}
function
checkForIntersections
(
e
,
objects
){
...
...
js/node.js
View file @
f4a1591a
...
...
@@ -5,7 +5,8 @@
var
nodeMaterial
=
new
THREE
.
MeshBasicMaterial
({
color
:
0x000000
,
side
:
THREE
.
DoubleSide
});
var
nodeMaterialFixed
=
new
THREE
.
MeshBasicMaterial
({
color
:
0x000000
,
side
:
THREE
.
DoubleSide
});
var
nodeMaterialHighlight
=
new
THREE
.
MeshBasicMaterial
({
color
:
0xffffff
,
side
:
THREE
.
DoubleSide
});
var
nodeGeo
=
new
THREE
.
SphereGeometry
(
1
,
20
);
var
transparentMaterial
=
new
THREE
.
MeshBasicMaterial
({
color
:
0xffffff
,
side
:
THREE
.
DoubleSide
,
opacity
:
0.5
,
transparent
:
true
});
var
nodeGeo
=
new
THREE
.
SphereGeometry
(
3
,
20
);
nodeGeo
.
rotateX
(
Math
.
PI
/
2
);
var
nodeFixedGeo
=
new
THREE
.
CubeGeometry
(
1
,
1
,
1
);
nodeFixedGeo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
0
,
0.25
,
0
)
);
...
...
@@ -144,6 +145,10 @@ Node.prototype.unhighlight = function(){
}
};
Node
.
prototype
.
setTransparent
=
function
(){
this
.
object3D
.
material
=
transparentMaterial
;
};
Node
.
prototype
.
hide
=
function
(){
this
.
object3D
.
visible
=
false
;
};
...
...
Write
Preview
Markdown
is supported
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