-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Polyline geometry #1115
Conversation
…to be projected to 2D and split for RTE.
…and adjacent positions.
Sounds cool. Update the tutorial. |
*/ | ||
GeometryPipeline.projectTo2D = function(geometry, projection) { | ||
GeometryPipeline.projectTo2D = function(geometry, attributeName, attributeName3D, attributeName2D, projection) { |
There was a problem hiding this comment.
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.
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 |
@@ -1037,10 +1039,11 @@ define([ | |||
return; | |||
} | |||
|
|||
var vsSource = PolylineCommon + '\n\n' + PolylineVS; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the parentheses.
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. |
Conflicts: CHANGES.md
…ted tests. Updated geometry Sandcastle example.
@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. |
OK, let's have a look then we'll make the call. It should be trivial to code.
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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Tests and Sandcastle example are good. This is ready pending those trivial comments. |
@pjcozzi This is ready for another review. |
Looks good. Merging. Also, as I said before:
CC @hpinkos |
Adds
PolylineGeometry
which creates polylines like those ofPolylineCollection
.Adds
PolylineColorAppearance
likePerInstanceColorAppearance
but for polylines.Adds
PolylineMaterialAppearance
.