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

Polyline geometry #1115

Merged
merged 18 commits into from
Sep 10, 2013
Merged

Polyline geometry #1115

merged 18 commits into from
Sep 10, 2013

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Sep 4, 2013

Adds PolylineGeometry which creates polylines like those of PolylineCollection.
Adds PolylineColorAppearance like PerInstanceColorAppearance but for polylines.
Adds PolylineMaterialAppearance.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 5, 2013

Sounds cool. Update the tutorial.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 5, 2013

Since polyline performance is such a hot topic, once we merge this, it is worth emailing the forum to tell folks to use this for fast static polylines, and that fast dynamic polylines are a little ways out, and to watch #932 for updates.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 5, 2013

In the Sandcastle example, is this Mac only?

image

*/
GeometryPipeline.projectTo2D = function(geometry, projection) {
GeometryPipeline.projectTo2D = function(geometry, attributeName, attributeName3D, attributeName2D, projection) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a breaking change, but I suppose no need to add the noise to CHANGES.md since it is very unlikely that other folks are using this.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 5, 2013

Since polyline performance is such a hot topic, once we merge this, it is worth emailing the forum to tell folks to use this for fast static polylines, and that fast dynamic polylines are a little ways out, and to watch #932 for updates.

This also allows for the highly sought-after per-vertex color. It would be good to show how to do this and perhaps build it directly into PolylineGeometry. We'd need to add color to VertexFormat, which I am OK with. It should just work with PolylineColorAppearance.

@@ -1037,10 +1039,11 @@ define([
return;
}

var vsSource = PolylineCommon + '\n\n' + PolylineVS;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a trivial case, but I would still use createShaderSource to keep the shader pipeline consistent. CC @gbeatty

*
* @see <a href='https://github.com/AnalyticalGraphicsInc/cesium/wiki/Fabric'>Fabric</a>
*/
this.material = (defined(options.material)) ? options.material : Material.fromType(undefined, Material.ColorType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop the parentheses.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 5, 2013

This looks pretty good. All the tests pass on Chrome and Firefox.

One final comment - how does a user interop between the outline geometries and the polyline geometry? Let's make it easy to construct a polyline geometry from an outline geometry, and add an example to Sandcastle.

@bagnell
Copy link
Contributor Author

bagnell commented Sep 7, 2013

@pjcozzi This is ready for another review.

For the screen shot you posted, I think that is just the polyline disappearing over the horizon.

For your comment about using polylines as outlines, I'll do that in a separate pull request. The outlines for extruded geometry may look strange.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 7, 2013

For your comment about using polylines as outlines, I'll do that in a separate pull request. The outlines for extruded geometry may look strange.

OK, let's have a look then we'll make the call. It should be trivial to code.

For the screen shot you posted, I think that is just the polyline disappearing over the horizon.

Err, OK, but it looks much different in Firefox and Chrome.

* @exception {DeveloperError} index must be a number greater than or equal to 0.
* @exception {DeveloperError} index + 3 is greater than the length of the array.
*/
Cartesian3.writeElements = function(cartesian, cartesianArray, index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add this to all the Cartesian types and to CHANGES.md. Sorry, I guess I wasn't clear enough. An @example would be good to.

All this is pretty standard every time I add something to these types.

Copy link
Contributor

Choose a reason for hiding this comment

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

At first glance, this function looks identical to the pack function that @mramato already added.

Copy link
Contributor

Choose a reason for hiding this comment

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

We'll take either, but it looks like unpack is duplicate with the previously existing fromArray (we misnamed writeElements to not mirror this). I'll let you guys sort out what is what, but it would be nice to stay with the from convention.

Copy link
Contributor

Choose a reason for hiding this comment

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

Keep in mind that the Packable and PackableForInterpolation interfaces are implemented by many different Core types. I'm fine with tweaking names, but we need to make sure things stay consistent for all types and that the names in the Packable interface make sense in relation to each other. I personally would just leave the Packable stuff as is and if we want to add a fromArray that just calls unpack I'm fine with that too. writeElements can just go away.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 7, 2013

Tests and Sandcastle example are good. This is ready pending those trivial comments.

@bagnell
Copy link
Contributor Author

bagnell commented Sep 9, 2013

@pjcozzi This is ready for another review.

@pjcozzi
Copy link
Contributor

pjcozzi commented Sep 10, 2013

Looks good. Merging. Also, as I said before:

Since polyline performance is such a hot topic, once we merge this, it is worth emailing the forum to tell folks to use this for fast static polylines, and that fast dynamic polylines are a little ways out, and to watch #932 for updates.

Sounds cool. Update the tutorial.

CC @hpinkos

pjcozzi added a commit that referenced this pull request Sep 10, 2013
@pjcozzi pjcozzi merged commit b66679c into master Sep 10, 2013
@pjcozzi pjcozzi deleted the polylineGeometry branch September 10, 2013 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants