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

PointPrimitive and PointPrimitiveCollection #2632

Merged
merged 38 commits into from
May 5, 2015
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
86e94c7
Started work on a point primitive.
emackey Apr 7, 2015
30c968d
Specify PrimitiveType.POINTS.
emackey Apr 7, 2015
bca313c
Added some shaders for PointPrimitiveCollection.
emackey Apr 8, 2015
a9ba911
First sign that it's working!
emackey Apr 8, 2015
92820a4
Tweak anti-aliasing.
emackey Apr 8, 2015
7221af4
Remove cruft.
emackey Apr 8, 2015
4adcff3
Rename 2 parameters to match entity.point, rearrange attributes.
emackey Apr 9, 2015
1bdcab5
Upgrade VAF to not split up un-indexed verts into 64k chunks.
emackey Apr 9, 2015
d9ed942
Copy fix from #2630.
emackey Apr 10, 2015
1a5923d
Merge remote-tracking branch 'origin/master' into point-primitive
emackey Apr 10, 2015
887213a
Add unit tests for PointPrimitive and its collection.
emackey Apr 10, 2015
6d0389f
Switch PointVisualizer to use PointPrimitives instead of Billboards.
emackey Apr 10, 2015
7bfd1be
Make the point sizes match the old behavior.
emackey Apr 13, 2015
7ccd504
Update CHANGES.md.
emackey Apr 13, 2015
1b847ad
Merge remote-tracking branch 'origin/master' into point-primitive
emackey Apr 14, 2015
ad5d2bf
Add clamps for min/max point sizes. Add browser-zoom scale.
emackey Apr 14, 2015
0bbf178
Fix problems with point size clamping logic.
emackey Apr 14, 2015
3c462a6
Merge remote-tracking branch 'origin/master' into point-primitive
emackey Apr 15, 2015
95d4943
Merge remote-tracking branch 'origin/master' into point-primitive
emackey Apr 21, 2015
91b3e91
Merge remote-tracking branch 'origin/master' into point-primitive
pjcozzi Apr 24, 2015
a025567
Remove unused variables.
emackey Apr 27, 2015
f0fdbe6
Add "Points" entity demo, and fix missing translucencyByDistance.
emackey Apr 27, 2015
cf2852d
Add development PointPrimitive demo.
emackey Apr 27, 2015
22f0cd4
Some updates after review. More to come.
emackey Apr 27, 2015
ae10cad
Destructor cleanup.
emackey Apr 28, 2015
cbdbf2c
Refactor pointPrimitive specs to use Specs/createScene.
emackey Apr 28, 2015
6cd15fa
Merge remote-tracking branch 'origin/master' into point-primitive
emackey Apr 29, 2015
62a4593
CHANGES.md - Pushed to v1.10.
emackey Apr 29, 2015
31c7920
Incorporate some changes from Billboards in #2669.
emackey Apr 29, 2015
d38ff18
Doc tweak.
emackey May 4, 2015
5dc4195
Merge remote-tracking branch 'origin/master' into point-primitive
emackey May 4, 2015
f073a28
Tweak CHANGES.md
pjcozzi May 4, 2015
36e3c20
Tweak doc
pjcozzi May 4, 2015
773cc50
Make `czm_nearFarScalar` a shared function.
emackey May 5, 2015
fe63450
Tweak tests.
emackey May 5, 2015
6f7fb55
Improve coverage by adding missing tests.
emackey May 5, 2015
698839d
Test name grammar cleanup.
emackey May 5, 2015
8bd5dc9
Added test for czm_nearFarScalar.
emackey May 5, 2015
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
36 changes: 2 additions & 34 deletions Apps/Sandcastle/gallery/Billboards.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Add billboard images, points, and markers to the scene.">
<meta name="description" content="Add billboard images and markers to the scene.">
<meta name="cesium-sandcastle-labels" content="Beginner, Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
Expand Down Expand Up @@ -161,32 +161,6 @@
});
}

function addPointBillboards() {
Sandcastle.declare(addPointBillboards);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
point : {
color : Cesium.Color.RED,
pixelSize : 8
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-80.50, 35.14),
point : {
color : Cesium.Color.BLUE,
pixelSize : 16
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-80.12, 25.46),
point : {
color : Cesium.Color.LIME,
pixelSize : 32
}
});
}

function addMarkerBillboards() {
Sandcastle.declare(addMarkerBillboards);

Expand Down Expand Up @@ -275,12 +249,6 @@
offsetByDistance();
Sandcastle.highlight(offsetByDistance);
}
}, {
text : 'Add point billboards',
onselect : function() {
addPointBillboards();
Sandcastle.highlight(addPointBillboards);
}
}, {
text : 'Add marker billboards',
onselect : function() {
Expand All @@ -293,7 +261,7 @@
viewer.entities.removeAll();
};
//Sandcastle_End
Sandcastle.finishedLoading();
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
Expand Down
177 changes: 177 additions & 0 deletions Apps/Sandcastle/gallery/Points.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
<!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, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Add points to the scene.">
<meta name="cesium-sandcastle-labels" content="Beginner, Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.9/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
"use strict";
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');

function addPoint() {
Sandcastle.declare(addPoint);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
point : {
pixelSize : 10,
color : Cesium.Color.YELLOW
}
});
}

function setPointProperties() {
Sandcastle.declare(setPointProperties);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
point : {
show : true, // default
color : Cesium.Color.SKYBLUE, // default: WHITE
pixelSize : 10, // default: 1
outlineColor : Cesium.Color.YELLOW, // default: BLACK
outlineWidth : 3 // default: 0
}
});
}

function changePointProperties() {
Sandcastle.declare(changePointProperties);

var entity = viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 300000.0),
point : {
pixelSize : 2
}
});

var point = entity.point;
point.pixelSize = 20.0;
point.color = Cesium.Color.YELLOW.withAlpha(0.33);
}

function addMultiplePoints() {
Sandcastle.declare(addMultiplePoints);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
point : {
color : Cesium.Color.RED,
pixelSize : 8
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-80.50, 35.14),
point : {
color : Cesium.Color.BLUE,
pixelSize : 16
}
});
viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-80.12, 25.46),
point : {
color : Cesium.Color.LIME,
pixelSize : 32
}
});
}

function scaleByDistance() {
Sandcastle.declare(scaleByDistance);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
point : {
// pixelSize will multiply by the scale factor, so in this
// example the size will range from 20px (near) to 5px (far).
pixelSize : 10,
scaleByDistance : new Cesium.NearFarScalar(1.5e2, 2.0, 1.5e7, 0.5)
}
});
}

function fadeByDistance() {
Sandcastle.declare(fadeByDistance);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883),
point : {
pixelSize : 20,
translucencyByDistance : new Cesium.NearFarScalar(1.5e2, 1.0, 1.5e7, 0.2)
}
});
}

Sandcastle.addToolbarMenu([{
text : 'Add point',
onselect : function() {
addPoint();
Sandcastle.highlight(addPoint);
}
}, {
text : 'Set point properties at creation',
onselect : function() {
setPointProperties();
Sandcastle.highlight(setPointProperties);
}
}, {
text : 'Change point properties',
onselect : function() {
changePointProperties();
Sandcastle.highlight(changePointProperties);
}
}, {
text : 'Add multiple points',
onselect : function() {
addMultiplePoints();
Sandcastle.highlight(addMultiplePoints);
}
}, {
text : 'Scale by viewer distance',
onselect : function() {
scaleByDistance();
Sandcastle.highlight(scaleByDistance);
}
}, {
text : 'Fade by viewer distance',
onselect : function() {
fadeByDistance();
Sandcastle.highlight(fadeByDistance);
}
}]);

Sandcastle.reset = function () {
viewer.entities.removeAll();
};
//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
Binary file added Apps/Sandcastle/gallery/Points.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading