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
9f924aa3
Commit
9f924aa3
authored
Sep 07, 2015
by
Amanda Ghassaei
Browse files
kind of crappy, but orbits around center of mass of lattice
parent
c0f2b189
Changes
4
Hide whitespace changes
Inline
Side-by-side
dependencies/OrbitControls.js
View file @
9f924aa3
...
...
@@ -130,6 +130,11 @@ THREE.OrbitControls = function ( object, domElement ) {
var
startEvent
=
{
type
:
'
start
'
};
var
endEvent
=
{
type
:
'
end
'
};
this
.
setTarget
=
function
(
target
){
//three vector
this
.
target
=
target
;
// this.target0 = this.target.clone();
};
this
.
rotateLeft
=
function
(
angle
)
{
if
(
angle
===
undefined
)
{
...
...
js/lattice/Lattice.js
View file @
9f924aa3
...
...
@@ -35,6 +35,7 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
this
.
listenTo
(
this
,
"
change:cellSeparation
"
,
this
.
_updateCellSeparation
);
this
.
listenTo
(
appState
,
"
change:currentNav
"
,
this
.
_navChanged
);
this
.
listenTo
(
this
,
"
change:cellsMin change:cellsMax
"
,
this
.
_updateThreeViewControls
);
this
.
_updateLatticeType
();
},
...
...
@@ -104,6 +105,13 @@ define(['underscore', 'backbone', 'appState', 'globals', 'plist', 'three', 'thre
if
(
globals
.
basePlane
)
globals
.
basePlane
.
set
(
"
zIndex
"
,
0
,
{
silent
:
silent
});
},
_updateThreeViewControls
:
function
(){
var
cellsMin
=
this
.
get
(
"
cellsMin
"
);
var
cellsMax
=
this
.
get
(
"
cellsMax
"
);
if
(
cellsMax
===
null
||
cellsMin
===
null
)
return
;
if
(
globals
.
threeView
)
globals
.
threeView
.
setOrbitControlsFor
(
this
.
get
(
"
cellsMin
"
).
clone
(),
this
.
get
(
"
cellsMax
"
).
clone
())
},
...
...
js/main.js
View file @
9f924aa3
...
...
@@ -250,12 +250,13 @@ require.config({
//};
//init stuff
require
([
'
appState
'
,
'
lattice
'
,
'
navbar
'
,
'
threeModel
'
,
'
threeView
'
,
'
flatUI
'
,
'
bootstrapSlider
'
,
'
ribbon
'
,
'
menuWrapper
'
,
'
scriptView
'
],
function
(
appState
,
lattice
,
Navbar
,
three
,
ThreeView
){
require
([
'
appState
'
,
'
lattice
'
,
'
navbar
'
,
'
threeModel
'
,
'
threeView
'
,
'
globals
'
,
'
flatUI
'
,
'
bootstrapSlider
'
,
'
ribbon
'
,
'
menuWrapper
'
,
'
scriptView
'
],
function
(
appState
,
lattice
,
Navbar
,
three
,
ThreeView
,
globals
){
new
Navbar
({
model
:
appState
});
new
ThreeView
({
model
:
three
});
var
threeView
=
new
ThreeView
({
model
:
three
});
globals
.
threeView
=
threeView
;
//todo fix this
// if (lattice.get("connectionType") != "gik") lattice.getUItarget().addCellAtIndex({x:0,y:0,z:0});//add a cell
});
js/three/ThreeView.js
View file @
9f924aa3
...
...
@@ -60,6 +60,10 @@ define(['underscore', 'backbone', 'three', 'appState', 'globals', 'lattice', 'or
this
.
controls
.
reset
();
},
setOrbitControlsFor
:
function
(
min
,
max
){
this
.
controls
.
setTarget
(
max
.
sub
(
min
).
divideScalar
(
2
).
add
(
min
));
},
////////////////////////////////////////////////////////////////////////////////
///////////////////////////////MOUSE EVENTS/////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
...
...
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