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
26b0e463
Commit
26b0e463
authored
May 04, 2017
by
amandaghassaei
Browse files
scale
parent
9c2f0097
Changes
2
Hide whitespace changes
Inline
Side-by-side
js/model.js
View file @
26b0e463
...
...
@@ -302,6 +302,10 @@ function initModel(globals){
geometry
.
computeBoundingSphere
();
geometry
.
center
();
var
scale
=
100
/
geometry
.
boundingSphere
.
radius
;
globals
.
scale
=
scale
;
globals
.
threeView
.
setScale
(
scale
);
object3D
.
geometry
.
dispose
();
object3D
.
geometry
=
geometry
;
object3D2
.
geometry
=
geometry
;
...
...
js/threeView.js
View file @
26b0e463
...
...
@@ -49,11 +49,11 @@ function initThreeView(globals) {
//scene.fog = new THREE.FogExp2(0xf4f4f4, 1.7);
//renderer.setClearColor(scene.fog.color);
camera
.
zoom
=
1
;
camera
.
zoom
=
5
;
camera
.
updateProjectionMatrix
();
camera
.
position
.
x
=
40
00
;
camera
.
position
.
y
=
40
00
;
camera
.
position
.
z
=
40
00
;
camera
.
position
.
x
=
2
00
;
camera
.
position
.
y
=
2
00
;
camera
.
position
.
z
=
2
00
;
controls
=
new
THREE
.
OrthographicTrackballControls
(
camera
,
renderer
.
domElement
);
controls
.
rotateSpeed
=
1.5
;
...
...
@@ -153,6 +153,10 @@ function initThreeView(globals) {
modelWrapper
.
children
=
[];
}
function
setScale
(
scale
){
modelWrapper
.
scale
.
set
(
scale
,
scale
,
scale
);
}
function
onWindowResize
()
{
camera
.
aspect
=
window
.
innerWidth
/
window
.
innerHeight
;
camera
.
left
=
-
window
.
innerWidth
/
2
;
...
...
@@ -192,6 +196,7 @@ function initThreeView(globals) {
enableControls
:
enableControls
,
scene
:
scene
,
camera
:
camera
,
running
:
running
running
:
running
,
setScale
:
setScale
}
}
\ No newline at end of file
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