Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Stavor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Orekit
Stavor
Commits
d42418a3
Commit
d42418a3
authored
10 years ago
by
Xavier Gibert
Browse files
Options
Downloads
Patches
Plain Diff
S/C multiple views with UP camera vector
parent
7f5ecf28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
assets/www/functions.js
+27
-2
27 additions, 2 deletions
assets/www/functions.js
assets/www/index.html
+16
-1
16 additions, 1 deletion
assets/www/index.html
assets/www/update.js
+46
-2
46 additions, 2 deletions
assets/www/update.js
res/values/arrays.xml
+7
-1
7 additions, 1 deletion
res/values/arrays.xml
with
96 additions
and
6 deletions
assets/www/functions.js
+
27
−
2
View file @
d42418a3
...
...
@@ -208,8 +208,33 @@ function showAndroidToast(toast) {
sunGlow
.
visible
=
false
;
camera
.
position
=
sun
.
position
.
clone
().
normalize
().
multiplyScalar
(
getCamDistance
());
break
;
case
"
S/C
"
:
//Spacecraft
camera
.
position
=
init_sc_dir
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
case
"
S/C-xyz
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_xyz
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_xyz
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-rear
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_rear
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_rear
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-front
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_front
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_front
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-top
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_top
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_top
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-bottom
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_bottom
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_bottom
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-left
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_left
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_left
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-right
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_right
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_right
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
default
:
//xyz
camera
.
position
=
new
THREE
.
Vector3
(
getCamEquilater
(),
getCamEquilater
(),
getCamEquilater
());
...
...
This diff is collapsed.
Click to expand it.
assets/www/index.html
+
16
−
1
View file @
d42418a3
...
...
@@ -89,7 +89,22 @@ This three.js demo is part of a collection at
var
torus_tube
=
0.5
;
var
sc_scale
=
1.5
;
var
init_sc_dir
=
new
THREE
.
Vector3
(
0
,
0
,
-
1
);
var
init_sc_dir_xyz
=
new
THREE
.
Vector3
(
-
0.577
,
0.577
,
-
0.577
);
var
init_sc_up_xyz
=
new
THREE
.
Vector3
(
0.577
,
0.577
,
0.577
);
var
init_sc_dir_rear
=
new
THREE
.
Vector3
(
0
,
0
,
-
1
);
var
init_sc_up_rear
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
var
init_sc_dir_front
=
new
THREE
.
Vector3
(
0
,
0
,
1
);
var
init_sc_up_front
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
var
init_sc_dir_top
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
var
init_sc_up_top
=
new
THREE
.
Vector3
(
0
,
0
,
1
);
var
init_sc_dir_bottom
=
new
THREE
.
Vector3
(
0
,
-
1
,
0
);
var
init_sc_up_bottom
=
new
THREE
.
Vector3
(
0
,
0
,
1
);
var
init_sc_dir_left
=
new
THREE
.
Vector3
(
1
,
0
,
0
);
var
init_sc_up_left
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
var
init_sc_dir_right
=
new
THREE
.
Vector3
(
-
1
,
0
,
0
);
var
init_sc_up_right
=
new
THREE
.
Vector3
(
0
,
1
,
0
);
var
sc_axis_lenght
=
sphere_radius
*
0.4
;
var
sc_body_color
=
0xDDDDDD
;
var
sc_window_color
=
0x00d4ff
;
...
...
This diff is collapsed.
Click to expand it.
assets/www/update.js
+
46
−
2
View file @
d42418a3
...
...
@@ -2,16 +2,60 @@ function update()
{
//Views
if
(
selected_view
==
"
Earth
"
){
switch
(
selected_view
){
case
"
Earth
"
:
//Earth
camera
.
position
=
earth
.
position
.
clone
().
normalize
().
multiplyScalar
(
getCamDistance
());
break
;
case
"
Sun
"
:
//Sun
camera
.
position
=
sun
.
position
.
clone
().
normalize
().
multiplyScalar
(
getCamDistance
());
break
;
case
"
S/C-xyz
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_xyz
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_xyz
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-rear
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_rear
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_rear
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-front
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_front
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_front
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-top
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_top
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_top
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-bottom
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_bottom
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_bottom
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-left
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_left
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_left
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
case
"
S/C-right
"
:
//Spacecraft
camera
.
position
=
init_sc_dir_right
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
()).
multiplyScalar
(
getCamDistance
());
camera
.
up
=
init_sc_up_right
.
clone
().
applyQuaternion
(
spacecraft
.
quaternion
.
clone
().
normalize
());
break
;
default
:
controls
.
update
();
break
;
}
camera
.
lookAt
(
scene
.
position
);
/*if(selected_view=="Earth"){
camera.position = earth.position.clone().normalize().multiplyScalar(getCamDistance());
}else if(selected_view=="Sun"){
camera.position = sun.position.clone().normalize().multiplyScalar(getCamDistance());
}else if(selected_view=="S/C"){
camera.position = init_sc_dir.clone().applyQuaternion(spacecraft.quaternion.clone().normalize()).multiplyScalar(getCamDistance());
camera.up = init_sc_up.clone().applyQuaternion(spacecraft.quaternion.clone().normalize());
}else{
controls.update();
}
camera
.
lookAt
(
scene
.
position
);
camera.lookAt(scene.position);
*/
//Ligts
light
.
position
.
set
(
camera
.
position
.
x
,
camera
.
position
.
y
,
camera
.
position
.
z
);
...
...
This diff is collapsed.
Click to expand it.
res/values/arrays.xml
+
7
−
1
View file @
d42418a3
...
...
@@ -10,6 +10,12 @@
<item>
-Z
</item>
<item>
Earth
</item>
<item>
Sun
</item>
<item>
S/C
</item>
<item>
S/C-xyz
</item>
<item>
S/C-rear
</item>
<item>
S/C-front
</item>
<item>
S/C-top
</item>
<item>
S/C-bottom
</item>
<item>
S/C-left
</item>
<item>
S/C-right
</item>
</string-array>
</resources>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment