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
DMDesign
Commits
1f5eac07
Commit
1f5eac07
authored
Sep 07, 2015
by
Amanda Ghassaei
Browse files
generalize orbit controls for all lattices
parent
05545562
Changes
2
Show whitespace changes
Inline
Side-by-side
js/lattice/Lattice.js
View file @
1f5eac07
...
@@ -109,7 +109,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
...
@@ -109,7 +109,8 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
var
cellsMin
=
this
.
get
(
"
cellsMin
"
);
var
cellsMin
=
this
.
get
(
"
cellsMin
"
);
var
cellsMax
=
this
.
get
(
"
cellsMax
"
);
var
cellsMax
=
this
.
get
(
"
cellsMax
"
);
if
(
cellsMax
===
null
||
cellsMin
===
null
)
return
;
if
(
cellsMax
===
null
||
cellsMin
===
null
)
return
;
if
(
globals
.
threeView
)
globals
.
threeView
.
setOrbitControlsFor
(
this
.
get
(
"
cellsMin
"
).
clone
(),
this
.
get
(
"
cellsMax
"
).
clone
())
var
center
=
cellsMax
.
clone
().
sub
(
cellsMin
).
divideScalar
(
2
).
add
(
cellsMin
);
if
(
globals
.
threeView
&&
this
.
getPositionForIndex
)
globals
.
threeView
.
setOrbitControlsFor
(
this
.
getPositionForIndex
(
center
));
},
},
...
...
js/three/ThreeView.js
View file @
1f5eac07
...
@@ -60,8 +60,8 @@ define(['underscore', 'backbone', 'three', 'appState', 'globals', 'lattice', 'or
...
@@ -60,8 +60,8 @@ define(['underscore', 'backbone', 'three', 'appState', 'globals', 'lattice', 'or
this
.
controls
.
reset
();
this
.
controls
.
reset
();
},
},
setOrbitControlsFor
:
function
(
min
,
max
){
setOrbitControlsFor
:
function
(
center
){
//lattice
min max
this
.
controls
.
setTarget
(
max
.
sub
(
min
).
divideScalar
(
2
).
add
(
min
));
this
.
controls
.
setTarget
(
center
);
//center of lattice bounds
},
},
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
...
...
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