# Example of animating a cylinder

**URL:** <https://community.cesium.com/t/example-of-animating-a-cylinder/26419>\
**Category:** CesiumJS\
**Created:** [August 29, 2023, 5:43pm UTC](https://community.cesium.com/t/example-of-animating-a-cylinder/26419 "2023-08-29T17:43:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nonprofits](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nonprofits/32/14552_2.png) [@Nonprofits](https://community.cesium.com/u/Nonprofits)\
**Post date:** [August 29, 2023, 5:43pm UTC](https://community.cesium.com/t/example-of-animating-a-cylinder/26419/1 "2023-08-29T17:43:24Z")

</div>

> [@Create a cylinder at a coordinate and point at another coordinate](https://community.cesium.com/t/create-a-cylinder-at-a-coordinate-and-point-at-another-coordinate/25285/6):
>
> You could create an animation in various ways (also depending on where the input data for the animation is coming from). In order to apply this to the cylinder, one rough outline of the approach would be split the createCylinderPrimitive method into two parts: One that computes the modelMatrix and one that creates the primitive with the Cesium.GeometryInstance During the animation, use the modified positions to create an updated version of the modelMatrix Assign that model matrix to the Geomet…

Hello, this is a follow-up to the post above. I was wondering if there are any examples of doing this sort of animation that I could use to help learn how to accomplish an updated modelMatrix over a period of time and apply it to a GeometryInstance. To effectively have a Cylinder move and re-orient over time based on coordinates I am feeding into the alignment functions.

[https://sandcastle.cesium.com/index.html#c=3Vhbb9s2FP4rhF8mDyqjmyXZSYu5blEEy9ouyVZsMDDQMm1zlUiBopO4Q/77DiXqYstOlw7Yw4TAES/nfr6PtBPBC4XuGL2nEr1EnN6jGS3YNsO/lnPWfJCU45ngijBO5XwwPJ/zOT87QzOR5VtFkdpQJIUiigmOLFIggoKHAGVESfYwhGWi0AamlUALikiep4wuSw0w852W/vKCPLDiO2QxTDEiHInFnzRRlShJ2ZrTJbpnaoPa3cNSQyGqTQz+iv7WFFwGo+qeUl5OrNkdvOWiYNrbYs5XW56UjidVNFOtIqNcXZuIrHqzYzdy7hD9NecIZHT6lmy1opLyhEIKTfpmRC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KSfEZiq/QXp/lg7z41OXLR0aTwhq4lpYUVeTgYueMgsF9EOHD145hnbHsBDqELyscPR05cgYOmKcsLwZaT5uoP6WCTE53gl/K6SP23Gm0tHrtFxtdv32Ad4jTNN8TqHHAmWLg1yS3dnyslD/S8vprOfqzgC5+PFdMfZN77r1MfxjiIPW8Uh2EQjnzXs90RDgIXQBKN/CiMnSiyfT8KnCh0cexHo3DsuP+rEvQo7+0DyfK0AWvRsNtzCLEHLffoff9fwOC8o9z7qvJvLLQxIlKKU7G2dBxH5rw6k6cSWP/wY3r7i4AbgbAOOn14PrAHF4XapfSVzvcPLMuFVGgrUwvjM0VBqb7Cny22yWeqcFKUPxFcnNUiF0t2h9jy5ZGfnlCSkqKAldU2TW/YF8DJq4sz2L8nlgpoYL7+cEdlSnZ6y8Z9dVVNYowvzmDYl1JCpAsiOxp1G/4N)

I was wondering if something that takes advantage of the CZML structure is possible as well?

Thank you
