Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrain #510

Merged
merged 308 commits into from
Feb 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
308 commits
Select commit Hold shift + click to select a range
43d4595
Fix terrain example after widget changes.
kring Nov 6, 2012
7a4be28
Use child bits in each tile.
kring Nov 7, 2012
b0f6603
Use terrain hosted on cesium.cloudapp.net.
kring Nov 8, 2012
06a2e3f
Don't unload tiles with transitioning imagery.
kring Nov 8, 2012
5d56c64
Fix base layer stretching beyond its extent.
kring Nov 8, 2012
312b0e7
Merge remote-tracking branch 'origin/master' into terrain
shunter Nov 9, 2012
6b91652
Update package list and fix widget startup.
shunter Nov 9, 2012
4a8ac94
Merge branch 'scheduleRenderLoop' into terrain
shunter Nov 9, 2012
eef53e0
Merge remote-tracking branch 'origin/ocean' into terrainAndOcean
kring Nov 14, 2012
b8f6489
Apply water material to terrain tiles.
kring Nov 14, 2012
22d5dba
Use high-res water mask derived from SRTM data.
kring Nov 15, 2012
24f9e1f
Slow down the wave animation.
kring Nov 15, 2012
8197d4c
Use the actual imagery color as the ocean base color.
kring Nov 15, 2012
0d9ee12
Tweak water fragment shader.
kring Nov 15, 2012
2330d10
Merge remote-tracking branch 'origin/master' into terrainAndOcean
kring Nov 15, 2012
2612e19
Fix apps that don't use CesiumTerrainProvider.
kring Nov 15, 2012
41af797
Merge branch 'master' into terrain
shunter Nov 16, 2012
92a5629
Temporarily use GTOPO30 terrain.
kring Nov 16, 2012
12f0633
Merge remote-tracking branch 'origin/master' into terrainAndOcean
kring Nov 16, 2012
7e3c189
Restore the fancy water.
kring Nov 16, 2012
aa655ac
Lighting tweaks.
kring Nov 16, 2012
17172c3
Switch to using terrain/water data on cesium.agi.com.
kring Nov 17, 2012
35937d0
Merge remote-tracking branch 'origin/master' into terrain
kring Nov 19, 2012
9f8db91
Merge branch 'terrain' into terrainAndOcean
kring Nov 19, 2012
e9bfec5
Merge branch 'master' into terrainAndOcean
pjcozzi Nov 20, 2012
4609b4c
Fix test failures and add a new test.
kring Nov 20, 2012
45bb4bb
Merge branch 'terrain' into terrainAndOcean
kring Nov 20, 2012
205475f
Fix Sandcastle examples and test failures.
kring Nov 20, 2012
e26104c
Merge branch 'lighting' into terrainAndOcean
kring Nov 21, 2012
354c296
Fix water shading.
kring Nov 21, 2012
011757c
Swap column and row parameters in Matrix*.getElementIndex.
bagnell Nov 21, 2012
d237da3
Matrix3.fromQuaternion was returning the transpose of the rotation ma…
bagnell Nov 21, 2012
f581b9d
Update CHANGES
mramato Nov 22, 2012
f534ace
Update CHANGES.md
mramato Nov 22, 2012
e5ca51f
Remove DistanceIntervalMaterial
pjcozzi Nov 22, 2012
c2ae2fd
Merged lighting into terrainAndOcean
pjcozzi Nov 26, 2012
6085e2c
Progress toward using a texture for the water mask.
kring Nov 26, 2012
b37237d
Working texture-based water masking.
kring Nov 26, 2012
68ff428
Fix use of ioQuery.
shunter Nov 26, 2012
9417ed9
Load water mask from terrain tiles.
kring Nov 26, 2012
135954d
Correctly handle missing water tiles.
kring Nov 26, 2012
5b38c60
Re-use water mask texture instead of re-uploading it.
kring Nov 26, 2012
887bfdc
Use smaller water normals texture.
kring Nov 26, 2012
05e0558
Optimizations to water shading.
kring Nov 26, 2012
3fcc021
Use SRTM terrain and watermask.
kring Nov 27, 2012
d36074a
Tile state improvements.
kring Nov 27, 2012
8f8929d
Remove workaround for bad data.
kring Nov 27, 2012
8669122
Merge branch 'lighting' into terrainAndOcean
pjcozzi Nov 27, 2012
618b806
Add water specular highlights even w/o ocean.
kring Nov 27, 2012
60e0e79
Merge remote-tracking branch 'origin/master' into terrain
kring Nov 27, 2012
b5a2078
Merge remote-tracking branch 'origin/lighting' into terrain
kring Nov 27, 2012
c232e19
Fix non-terrain examples.
kring Nov 27, 2012
a566998
Merge remote-tracking branch 'origin/lighting' into terrainAndOcean
kring Nov 28, 2012
70efd84
Merge remote-tracking branch 'origin/master' into terrainAndOcean
kring Nov 29, 2012
aba85dd
Merge remote-tracking branch 'origin/master' into terrain
kring Dec 5, 2012
2c98549
Merge remote-tracking branch 'origin/terrainAndOcean' into terrain
kring Dec 5, 2012
71a38d7
Make water normal textures seamless.
kring Dec 5, 2012
cf691c2
Fix ocean on Android devices.
kring Dec 5, 2012
8479405
Don't over-allocate memory for vertices.
kring Dec 5, 2012
28efcbc
Load terrain from cesium.agi.com.
kring Dec 5, 2012
162ea31
Remove old varying from CB vertex shader.
kring Dec 6, 2012
1ce0c1c
WIP improvements to Columbus View / 2D lighting.
kring Dec 7, 2012
d6c86f2
Closer to correct 2D/CV lighting.
kring Dec 7, 2012
fcca8e5
Merge remote-tracking branch 'origin/camera' into lighting2d
kring Dec 10, 2012
80cb21e
Adjust terrain example after camera merge.
kring Dec 10, 2012
47237dd
Fix 2D lighting.
kring Dec 10, 2012
abdf1b4
Fix lighting discontinuity when the camera leaves reality.
kring Dec 10, 2012
6e081ce
Eliminate allocations in view2DTo3D.
kring Dec 10, 2012
81e9cd2
Merge remote-tracking branch 'origin/master' into lighting2d
kring Dec 11, 2012
31956fe
Merge remote-tracking branch 'origin/master' into terrain
kring Dec 11, 2012
29b0381
Merge remote-tracking branch 'origin/terrain' into lighting2d
kring Dec 11, 2012
043e631
Cleanup, mostly of documentation.
kring Dec 11, 2012
b540e63
Add tests for new automatic uniforms.
kring Dec 11, 2012
a0a5624
Merge branch 'master' into lighting2d
mramato Dec 11, 2012
c090b1c
Fix exception at Terrain example startup.
kring Dec 11, 2012
881ad1d
Lighting tweaks.
kring Dec 11, 2012
9d42179
Much improved lighting in both 3D and 2D.
kring Dec 11, 2012
89c0f5d
Lighting tweaks.
kring Dec 12, 2012
15d213b
Lighting cleanup.
kring Dec 12, 2012
31a606c
Merge remote-tracking branch 'origin/master' into terrain
kring Dec 12, 2012
50bf74c
Merge remote-tracking branch 'origin/terrain' into lighting2d
kring Dec 12, 2012
0904777
Build ocean rendering into CentralBody.
kring Dec 12, 2012
d7e06c8
Make no-wave shading match with-wave shading.
kring Dec 12, 2012
15ea3af
Fix non-terrain examples.
kring Dec 12, 2012
b02b935
Merge remote-tracking branch 'origin/master' into terrain
kring Dec 12, 2012
5ff6291
Fix water in 2D.
kring Dec 12, 2012
ea578d5
Changes from review.
kring Dec 12, 2012
28e8d1c
Merge pull request #367 from AnalyticalGraphicsInc/lighting2d
kring Dec 12, 2012
e88ff8b
Pseudo-moon highlight and texture coordinates at the poles.
kring Dec 13, 2012
d7aafcd
Merge remote-tracking branch 'origin/master' into terrain
emackey Dec 13, 2012
e101262
Tweak Terrain demo in Sandcastle.
emackey Dec 13, 2012
09580e0
More Terrain Sandcastle demo tweaks.
emackey Dec 13, 2012
fd54bf4
Fix tile bounding sphere debugging.
kring Dec 13, 2012
7011677
Use the new, smaller terrain source.
kring Dec 13, 2012
5a6ae53
Imagery refinement prior to terrain downloaded.
kring Dec 13, 2012
ecfa351
Fix remaining problems with terrain refinement.
kring Dec 14, 2012
8cdff05
Build createVerticesFromHeightmap
vicb Dec 14, 2012
50b47b2
Render terrain in Columbus View.
kring Dec 14, 2012
ac3923a
Merge remote-tracking branch 'origin/master' into terrain
mramato Dec 17, 2012
5945bce
Merge pull request #381 from vicb/terrain
kring Dec 18, 2012
8d94cbd
Merge branch 'master' into terrain
mramato Jan 2, 2013
134a4df
Merge remote-tracking branch 'origin/master' into terrain
mramato Jan 2, 2013
249f183
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 3, 2013
9b712d1
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 4, 2013
b5f913b
Remove redundant memberof tags.
kring Jan 4, 2013
08a8b78
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 7, 2013
0b2c737
Fix non-terrain examples.
kring Jan 7, 2013
1bbae82
Fix firefox warning caused by invalid max anisotropy setting.
kring Jan 7, 2013
e4bc7ea
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 7, 2013
d1c0e78
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 7, 2013
8ddb73b
Merge remote-tracking branch 'origin/useCreateSampler' into terrain
kring Jan 7, 2013
a09a145
Create the water texture sampler properly.
kring Jan 7, 2013
e190b4b
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 7, 2013
4aa3179
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 7, 2013
62f8b4f
Revert changes to Water.glsl.
kring Jan 7, 2013
52628da
Revert changes to Texture.js.
kring Jan 7, 2013
3fb37b8
Revert changes to Texture.js, correctly this time.
kring Jan 7, 2013
c49fa46
Add new tile state, IMAGERY_SKELETONS_CREATED.
kring Jan 8, 2013
3b30bc0
Merge branch 'firefoxWorkerBug' into terrain
kring Jan 8, 2013
93bd476
Work around Firefox transferable object bug.
kring Jan 8, 2013
86abdc2
Fix intermittent blue tiles.
kring Jan 8, 2013
42e0527
Start terrain provider refactoring.
kring Jan 9, 2013
58ce03f
Start handling terrain in CentralBodySurface.
kring Jan 10, 2013
60f8cc4
Ongoing refactoring - currently completely broken.
kring Jan 11, 2013
e02c82d
Fix createVerticesFromHeightmap worker layer
shunter Jan 14, 2013
3bf3c37
Copy createVerticesFromHeightmap after the Dojo build too.
shunter Jan 14, 2013
7ed561a
Merge remote-tracking branch 'origin/master' into terrain
kring Jan 24, 2013
0aab855
Merge branch 'terrain' into terrainRefactoring
kring Jan 24, 2013
400b46a
Ongoing terrain refactoring.
kring Jan 25, 2013
3c76874
Fix crash on render.
kring Jan 25, 2013
5d5a5cd
Terrain working is semi-working again.
kring Jan 25, 2013
72c9288
Less buggy terrain rendering.
kring Jan 25, 2013
d0b393e
Include correct bounding sphere in tile commands.
kring Jan 25, 2013
76d7c6c
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Jan 28, 2013
e9f952f
Properly free loaded and upsampled terrain.
kring Jan 28, 2013
f05734a
Eliminate Tile.renderable property.
kring Jan 28, 2013
da34e8d
Eliminate Tile.doneLoading property.
kring Jan 28, 2013
924c3a9
Remove the Tile.center property.
kring Jan 28, 2013
f63760a
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Jan 29, 2013
5568a06
Ongoing refactoring.
kring Jan 29, 2013
d56acae
Move transformation to TerrainData.
kring Jan 29, 2013
5ebc2b4
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Jan 30, 2013
fe4c6d7
Minor reorganization.
kring Jan 30, 2013
c95ee3c
Fix upsampling, at least mostly.
kring Jan 30, 2013
55e8902
Free upsampled resources after load is ready.
kring Jan 30, 2013
398e182
Support upsampling by interpolation when stride===1.
kring Jan 30, 2013
fd07c6b
Remove unneeded code from CesiumTerrainProvider.
kring Jan 30, 2013
6418173
Fix EllipsoidTerrainProvider.
kring Jan 30, 2013
decc785
Rename requestTileGeometry2 to requestTileGeometry.
kring Jan 30, 2013
172fa42
Rename 'process' to 'tileTerrain'.
kring Jan 30, 2013
16927ab
Minor reorganization.
kring Jan 30, 2013
9f541d0
Refactor load pipeline again.
kring Jan 31, 2013
ab54c77
Possibly reload terrain after after upsampling it.
kring Jan 31, 2013
a63529f
Fix load-after-upsample.
kring Jan 31, 2013
408929a
Cleanup code and memory.
kring Jan 31, 2013
e968e3c
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Jan 31, 2013
55a32dc
Fix terrain example after merge from master.
kring Jan 31, 2013
61cf3b1
Start moving some code in CentralBodySurface to TileTerrain.
kring Feb 1, 2013
518ce65
Do less sketchy stuff in promise callbacks.
kring Feb 1, 2013
66c394e
Eliminate unnecessary function.
kring Feb 1, 2013
f8c78dc
Don't even create a loading TileTerrain if data is not available.
kring Feb 1, 2013
2578165
Move state machine processing to TileTerrain.
kring Feb 1, 2013
0c0b5c9
Move scratch variables close to where they're used.
kring Feb 1, 2013
0688d56
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Feb 1, 2013
31ae185
Rename ImageryProviderError to TileProviderError.
kring Feb 1, 2013
67ae947
Add loaded tiles to the replacement queue.
kring Feb 1, 2013
8013678
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Feb 1, 2013
9106492
Fix test failures.
kring Feb 1, 2013
9d30cc5
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Feb 4, 2013
e5762b2
Hook water rendering back up.
kring Feb 4, 2013
2664268
Free old water texture before assigning a new one.
kring Feb 4, 2013
7800747
Fix incorrect water mask coordinates.
kring Feb 4, 2013
e24368e
Better handling of new data when it arrives.
kring Feb 5, 2013
349f708
Reduce length of tile skirts.
kring Feb 5, 2013
4064d47
Fix tile bounding sphere compuation.
kring Feb 5, 2013
cfbf753
Compute tile bounding spheres in web worker.
kring Feb 5, 2013
3ff2dcc
Start computing 2D bounding sphere in worker, too.
kring Feb 5, 2013
d84529f
Merge remote-tracking branch 'origin/master' into terrainRefactoring
kring Feb 6, 2013
fa73a84
Compute "occludee point" in web worker.
kring Feb 6, 2013
4ee1c93
Eliminate unused require.
kring Feb 6, 2013
126987e
Change TODO to a regular comment.
kring Feb 6, 2013
471408a
Remove TODOs (they're roadmap items).
kring Feb 6, 2013
630817b
Fix ArcGisImageServerTerrainProvider.
kring Feb 6, 2013
b52e857
Support interpolation for terrain with stride.
kring Feb 6, 2013
fe66cec
Refactor processLoadStateMachine in preparation for error handling.
kring Feb 6, 2013
79192d8
Handle terrain request errors much like imagery errors.
kring Feb 7, 2013
e08acdd
Remove old terrain providers.
kring Feb 7, 2013
0c17b87
Merge remote-tracking branch 'origin/master' into terrain
kring Feb 7, 2013
bc53d7b
Clean up CesiumTerrainProvider.
kring Feb 7, 2013
a99ce98
Doc improvements.
kring Feb 7, 2013
34bb13c
More TerrainProvider cleanup.
kring Feb 7, 2013
4f5c740
EllipsoidTerrainProvider does not have a water mask.
kring Feb 7, 2013
45bc7e3
Clean up HeightmapTerrainData.
kring Feb 7, 2013
c97594e
Add doc for TerrainMesh.
kring Feb 7, 2013
a77b692
Fix ArcGisImageServerTerrainProvider (again).
kring Feb 7, 2013
785cf4d
Clean up ArcGisImageServerTerrainProvider.
kring Feb 7, 2013
7b36d69
Do not limit terrain providers to a max level.
kring Feb 7, 2013
875b6ca
Improve TileTerrain doc, even though it's private.
kring Feb 7, 2013
e97fd85
Fix TerrainMesh doc error.
kring Feb 7, 2013
82684aa
Add an option to depth test primitives against terrain.
kring Feb 7, 2013
f73c78a
Clean up HeightmapTessellator.
kring Feb 7, 2013
68214e4
A bit more doc for HeightmapTessellator.
kring Feb 7, 2013
386e7e0
Remove ExtentTessellator and createVertexFromExtent.
kring Feb 7, 2013
77ba47c
Resurrect ExtentTessellator - it's needed after all.
kring Feb 7, 2013
a00c61d
Heightmap tweaks.
kring Feb 8, 2013
60fe38f
Doc tweaks.
kring Feb 8, 2013
fd7e61a
Overhaul Terrain Sandcastle example.
kring Feb 8, 2013
de20c66
Fix build.xml handling of createVerticesFromHeightmap.
kring Feb 8, 2013
b2df538
Add tests for Ellipsoid and ArcGisImageServerTerrainProvider.
kring Feb 11, 2013
0ec8e1f
Add tests and doc for HeightmapTessellator.
kring Feb 11, 2013
d886402
More tests for HeightmapTessellator.
kring Feb 11, 2013
22f66cb
HeightmapTessellator tweaks from review.
kring Feb 11, 2013
c6dfd9c
Rename setCameraPosition to setCamera.
kring Feb 11, 2013
653b7f1
Eliminate two dirty flags.
kring Feb 11, 2013
657596d
Add ArcGisImageServerTerrainProvider example.
kring Feb 11, 2013
81d34fe
Allow user to configure tile cache size.
kring Feb 11, 2013
3df75cc
Don't pass explicit 0.0's when constructing Cartesian3, etc.
kring Feb 11, 2013
b25be19
HeightmapTerrainData doc improvements.
kring Feb 11, 2013
c5c9ca1
HeightmapTerrainData changes from review.
kring Feb 11, 2013
ffc9b4a
Reorg CB fragment shader for less #ifdef nesting.
kring Feb 11, 2013
6f9a026
Simplify the UI of the terrain sandcastle example.
shunter Feb 11, 2013
8b2b5b7
Remove unused dependency.
shunter Feb 11, 2013
d148d1f
Combine position3D and height vertex attributes.
kring Feb 12, 2013
5b8484e
Mention that HeightmapTessellator employs a lot of inlining.
kring Feb 12, 2013
44dcef7
Eliminate duplication of water noise GLSL function.
kring Feb 12, 2013
e32afd9
Fix links to uniforms in ShaderProgram.
kring Feb 12, 2013
23112e6
Remove incorrect undefined check. The shaders in the storage object …
shunter Feb 12, 2013
db07974
Fix several doc problems.
kring Feb 12, 2013
44e2723
Enable back-face culling in all modes.
kring Feb 12, 2013
73f760f
Replace setTerrainProvider method with terrainProvider property.
kring Feb 12, 2013
996168c
Fix fullscreen in the terrain example.
kring Feb 12, 2013
9edfcf1
Fix undefined check failures.
kring Feb 12, 2013
9d58735
Fix whitespace mistakes.
shunter Feb 12, 2013
4c673fc
More tests for ArcGisImageServerTerrainProvider.
kring Feb 12, 2013
b25cd3d
TerrainProvider test improvements.
kring Feb 12, 2013
e10853a
Add tests for switching terrain providers.
kring Feb 12, 2013
1d99511
Fix a bug that could stop tile loading too soon.
kring Feb 12, 2013
a875191
Move tile state machine processing to Tile itself.
kring Feb 12, 2013
397b42e
Add tests for Tile. Also fix failures in CentralBodySurfaceSpec.
kring Feb 13, 2013
69908b3
Improve Tile tests, and fix some weirdness.
kring Feb 13, 2013
3b6f3fc
More Tile tests.
kring Feb 13, 2013
5102766
Add tests for HeightmapTerrainData.
kring Feb 13, 2013
0727084
Clean up attribute array construction.
kring Feb 13, 2013
00742b4
Fix CentralBody doc problem.
kring Feb 13, 2013
a6c59eb
Make zoom buttons work in 2D.
kring Feb 13, 2013
a2fd7cf
Fix doc problems.
kring Feb 14, 2013
f9471f4
Add TilingScheme tests.
kring Feb 15, 2013
7ca3e4d
Update CHANGES.md.
kring Feb 15, 2013
9ca73fb
Remove dead code from CentralBodySurface.
kring Feb 15, 2013
ddbaee3
Merge remote-tracking branch 'origin/master' into terrain
kring Feb 15, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
165 changes: 165 additions & 0 deletions Apps/Sandcastle/gallery/Terrain.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE -->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Visualize worldwide, high-resolution terrain.">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript">
var dojoConfig = {
baseUrl : '../../../Source',
packages: [
{ name: 'dojo', location: '../ThirdParty/dojo-release-1.8.3-src/dojo' },
{ name: 'dijit', location: '../ThirdParty/dojo-release-1.8.3-src/dijit' },
{ name: 'dojox', location: '../ThirdParty/dojo-release-1.8.3-src/dojox' }
]
};
</script>
<script data-dojo-config="async: 1, tlmSiblingOfDojo: 0" src="../../../ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js"></script>
<link rel="stylesheet" href="../../../ThirdParty/dojo-release-1.8.3-src/dijit/themes/claro/claro.css" type="text/css">
<link rel="stylesheet" href="../../../Source/Widgets/Dojo/CesiumViewerWidget.css" type="text/css">
</head>
<body class="claro sandcastle-loading" data-sandcastle-bucket="bucket-dojo.html" data-sandcastle-title="Cesium + Dojo">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<div id="terrainMenu"></div>
<div id="zoomButtons"></div>
</div>
<script id="cesium_sandcastle_script">
require([
'Cesium',
'Widgets/Dojo/CesiumViewerWidget',
'dijit/DropDownMenu',
'dijit/MenuItem',
'dijit/form/Button',
'dijit/form/DropDownButton'
], function(
Cesium,
CesiumViewerWidget,
DropDownMenu,
MenuItem,
Button,
DropDownButton) {
"use strict";

function createTerrainMenu(terrainProviders) {
var menu = new DropDownMenu();
var button = new DropDownButton({
label : terrainProviders[0].name,
dropDown : menu
});

function createTerrainMenuItem(button, providerInfo) {
return new MenuItem({
label : providerInfo.name,
onClick : function() {
centralBody.terrainProvider = providerInfo.provider;
button.set('label', providerInfo.name);
}
});
}

for (var i = 0, len = terrainProviders.length; i < len; ++i) {
menu.addChild(createTerrainMenuItem(button, terrainProviders[i]));
}

button.placeAt('terrainMenu');

new Button({
label: 'Mount Everest',
onClick: function() {
var eye, target, up;

if (scene.mode === Cesium.SceneMode.SCENE3D) {
eye = new Cesium.Cartesian3(294572.0645397696, 5637826.573008351, 2978624.6868285);
target = eye.add(new Cesium.Cartesian3(0.9028130862217908, -0.42449297750082904, -0.06880583840911567));
up = new Cesium.Cartesian3(0.40668971896562117, 0.790807045510862, 0.45741413322152297);
scene.getCamera().controller.lookAt(eye, target, up);
} else if (scene.mode === Cesium.SceneMode.COLUMBUS_VIEW) {
eye = new Cesium.Cartesian3(9684590.891310014, 3114799.076252769, 9849.375792522824);
target = eye.add(new Cesium.Cartesian3(-0.8929328433855669, -0.00005779973945286486, -0.45018988645076763));
up = new Cesium.Cartesian3(-0.4501898855076042, -0.0000291369789812141, 0.8929328452557279);
scene.getCamera().controller.lookAt(eye, target, up);
} else {
scene.getCamera().controller.viewExtent(new Cesium.Extent(1.516102969, 0.48744464, 1.518102969, 0.48944464));
}
}
}).placeAt('zoomButtons');

new Button({
label: 'Half Dome',
onClick: function() {
var eye, target, up;

if (scene.mode === Cesium.SceneMode.SCENE3D) {
eye = new Cesium.Cartesian3(-2496304.1498512086, -4391818.97382059, 3884176.4503971986);
target = eye.add(new Cesium.Cartesian3(0.9279518715011381, -0.29488412129953234, -0.22792252890604328));
up = new Cesium.Cartesian3(-0.11836693744723503, -0.8130611584421428, 0.5700182635106171);
scene.getCamera().controller.lookAt(eye, target, up);
} else if (scene.mode === Cesium.SceneMode.COLUMBUS_VIEW) {
eye = new Cesium.Cartesian3(-13314946.646404704, 4200941.442507448, 2468.225945515426);
target = eye.add(new Cesium.Cartesian3(0.9624895834866811, 0.04124314776883213, -0.26816562874787864));
up = new Cesium.Cartesian3(0.2679197697914868, 0.011480478929947842, 0.9633728227203466);
scene.getCamera().controller.lookAt(eye, target, up);
} else {
scene.getCamera().controller.viewExtent(new Cesium.Extent(-2.08724538, 0.6577939, -2.08524538, 0.6597939));
}
}
}).placeAt('zoomButtons');

new Button({
label: 'San Francisco Bay',
onClick: function() {
var eye, target, up;

if (scene.mode === Cesium.SceneMode.SCENE3D) {
eye = new Cesium.Cartesian3(-2674718.9291375633, -4332137.224608461, 3888180.6614196445);
target = eye.add(new Cesium.Cartesian3(-0.40034097132786534, 0.9155843741828319, 0.03784653786617176));
up = new Cesium.Cartesian3(-0.6502679490649945, -0.3129458646313862, 0.6922546353438556);
scene.getCamera().controller.lookAt(eye, target, up);
} else if (scene.mode === Cesium.SceneMode.COLUMBUS_VIEW) {
eye = new Cesium.Cartesian3(-13562569.113918452, 4176598.9965795614, 37656.37201701476);
target = eye.add(new Cesium.Cartesian3(-0.8108519561707095, 0.4023795334200999, -0.42498213639958615));
up = new Cesium.Cartesian3(-0.3806859699462094, 0.18891270085627615, 0.905201736488051);
scene.getCamera().controller.lookAt(eye, target, up);
} else {
scene.getCamera().controller.viewExtent(new Cesium.Extent(-2.147621889, 0.64829691, -2.125621889, 0.67029691));
}
}
}).placeAt('zoomButtons');
}

var widget = new CesiumViewerWidget();
widget.placeAt('cesiumContainer');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add widget.fullscreenElement = document.body; here so that everything shows up in full screen mode and not just the viewer widget.

widget.fullscreenElement = document.body;
widget.startup();

var scene = widget.scene;
var centralBody = scene.getPrimitives().getCentralBody();

var terrainProvider = new Cesium.CesiumTerrainProvider({
url : 'http://cesium.agi.com/smallterrain'
});

centralBody.terrainProvider = terrainProvider;

var ellipsoidProvider = new Cesium.EllipsoidTerrainProvider();

var terrainProviders = [
{ name : 'CesiumTerrainProvider', provider : terrainProvider },
{ name : 'EllipsoidTerrainProvider', provider : ellipsoidProvider }
];

createTerrainMenu(terrainProviders);

Sandcastle.finishedLoading();
});
</script>
</body>
</html>
Binary file added Apps/Sandcastle/gallery/Terrain.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ Beta Releases

* Breaking changes:
* `IntersectionTests.rayPlane` now takes the new `Plane` type instead of separate `planeNormal` and `planeD` arguments.
* Renamed `ImageryProviderError` to `TileProviderError`.
* Added support for global terrain visualization via `CesiumTerrainProvider` and `ArcGisImageServerTerrainProvider`. See the [Terrain Tutorial](http://cesium.agi.com/2013/02/15/Cesium-Terrain-Tutorial/) for more information.
* Added `Plane` for representing the equation of a plane.
* Added a line segment-plane intersection test to `IntersectionTests`.
* Fixed an issue where a `PolylineCollection` with a model matrix other than the identity would be incorrectly rendered in 2D and Columbus view.
* Fixed an issue in the `ScreenSpaceCameraController` where disabled mouse events can cause the camera to be moved after being re-enabled.
* Added interactive extent drawing to the `Picking` Sandcastle example.
* Added `HeightmapTessellator` to create a mesh from a heightmap.
* Improved the lighting used in 2D and Columbus View modes. In general, the surface lighting in these modes should look just like it does in 3D.

### b13 - 2013-02-01

Expand Down
Binary file modified Source/Assets/Textures/waterNormals.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Source/Assets/Textures/waterNormalsSmall.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions Source/Core/BoundingSphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,10 @@ define([
};

var defaultProjection = new GeographicProjection();
var fromExtent2DLowerLeft = new Cartesian3(0.0, 0.0, 0.0);
var fromExtent2DUpperRight = new Cartesian3(0.0, 0.0, 0.0);
var fromExtent2DSouthwest = new Cartographic(0.0, 0.0, 0.0);
var fromExtent2DNortheast = new Cartographic(0.0, 0.0, 0.0);
var fromExtent2DLowerLeft = new Cartesian3();
var fromExtent2DUpperRight = new Cartesian3();
var fromExtent2DSouthwest = new Cartographic();
var fromExtent2DNortheast = new Cartographic();

/**
* Computes a bounding sphere from an extent projected in 2D.
Expand Down
29 changes: 29 additions & 0 deletions Source/Core/Ellipsoid.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,35 @@ define([
this._centerToleranceSquared = CesiumMath.EPSILON1;
};

/**
* Duplicates an Ellipsoid instance.
*
* @memberof Ellipsoid
*
* @param {Ellipsoid} ellipsoid The ellipsoid to duplicate.
* @param {Ellipsoid} [result] The object onto which to store the result, or undefined if a new
* instance should be created.
* @returns {Ellipsoid} The cloned Ellipsoid.
*/
Ellipsoid.clone = function(ellipsoid, result) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense for this to be a "static" function? Everything else in this file is on the prototype. At the very least we should provide a prototype version (and my vote would be to get rid of the static version). Also, we usually treat Ellipsoid as an immutable type (obviously it can't really be one in javascript), does providing a result parameter here break that paradigm? Don't we have a bunch of baked in assumptions that Ellipsoids don't change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this to reconstitute an ellipsoid after passing it to a web worker. All the functions get stripped away and only the fields are left. By taking this neutered Ellipsoid and passing it through Ellipsoid.clone, I get back an actual Ellipsoid that is equivalent to the original. A prototype method won't work for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for me.

var radii = ellipsoid._radii;

if (typeof result === 'undefined') {
return new Ellipsoid(radii.x, radii.y, radii.z);
}

Cartesian3.clone(radii, result._radii);
Cartesian3.clone(ellipsoid._radiiSquared, result._radiiSquared);
Cartesian3.clone(ellipsoid._radiiToTheFourth, result._radiiToTheFourth);
Cartesian3.clone(ellipsoid._oneOverRadii, result._oneOverRadii);
Cartesian3.clone(ellipsoid._oneOverRadiiSquared, result._oneOverRadiiSquared);
result._minimumRadius = ellipsoid._minimumRadius;
result._maximumRadius = ellipsoid._maximumRadius;
result._centerToleranceSquared = ellipsoid._centerToleranceSquared;

return result;
};

/**
* Computes an Ellipsoid from a Cartesian specifying the radii in x, y, and z directions.
*
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/EllipsoidalOccluder.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ define([
}

this._ellipsoid = ellipsoid;
this._cameraPosition = new Cartesian3(0.0, 0.0, 0.0);
this._cameraPositionInScaledSpace = new Cartesian3(0.0, 0.0, 0.0);
this._cameraPosition = new Cartesian3();
this._cameraPositionInScaledSpace = new Cartesian3();
this._distanceToLimbInScaledSpaceSquared = 0.0;

// setCameraPosition fills in the above values
Expand Down Expand Up @@ -95,7 +95,7 @@ define([
return this._cameraPosition;
};

var scratchCartesian = new Cartesian3(0.0, 0.0, 0.0);
var scratchCartesian = new Cartesian3();

/**
* Determines whether or not a point, the <code>occludee</code>, is hidden from view by the occluder.
Expand Down
33 changes: 24 additions & 9 deletions Source/Core/Extent.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,41 @@ define([
};

/**
* Duplicates this Extent.
* Duplicates an Extent.
*
* @param {Extent} [result] The object onto which to store the result.
* @memberof Extent
*
* @param {Extent} extent The extent to clone.
* @param {Extent} [result] The object onto which to store the result, or undefined if a new instance should be created.
* @return {Extent} The modified result parameter or a new Extent instance if none was provided.
*/
Extent.prototype.clone = function(result) {
Extent.clone = function(extent, result) {
if (typeof result === 'undefined') {
return new Extent(this.west, this.south, this.east, this.north);
return new Extent(extent.west, extent.south, extent.east, extent.north);
}
result.west = this.west;
result.south = this.south;
result.east = this.east;
result.north = this.north;
result.west = extent.west;
result.south = extent.south;
result.east = extent.east;
result.north = extent.north;
return result;
};

/**
* Duplicates this Extent.
*
* @memberof Extent
*
* @param {Extent} [result] The object onto which to store the result.
* @return {Extent} The modified result parameter or a new Extent instance if none was provided.
*/
Extent.prototype.clone = function(result) {
return Extent.clone(this, result);
};

/**
* Compares the provided Extent with this Extent componentwise and returns
* <code>true</code> if they are equal, <code>false</code> otherwise.
* @memberof Cartesian3
* @memberof Extent
*
* @param {Extent} [other] The Extent to compare.
* @return {Boolean} <code>true</code> if the Extents are equal, <code>false</code> otherwise.
Expand Down
1 change: 1 addition & 0 deletions Source/Core/ExtentTessellator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define([
*
* @exports ExtentTessellator
*
* @see HeightmapTessellator
* @see CubeMapEllipsoidTessellator
* @see BoxTessellator
* @see PlaneTessellator
Expand Down
Loading