# VelocityOrientationProperty Cesium CZML

**URL:** <https://community.cesium.com/t/velocityorientationproperty-cesium-czml/5986>\
**Category:** CesiumJS\
**Created:** [August 25, 2017, 10:27am UTC](https://community.cesium.com/t/velocityorientationproperty-cesium-czml/5986 "2017-08-25T10:27:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![frodrigues.vexiza](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@frodrigues.vexiza](https://community.cesium.com/u/frodrigues.vexiza)\
**Post date:** [August 25, 2017, 10:27am UTC](https://community.cesium.com/t/velocityorientationproperty-cesium-czml/5986/1 "2017-08-25T10:27:57Z")

</div>

Hi,

I have implemented a aircraft model 3d to move along a path of czml, but the orientation is bad.

I saw this example [https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Interpolation.html&label=All](https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Interpolation.html&label=All)

but I don´t understand how I can apply it in CZML. Please some example this? Thanks.

[![](https://lh3.googleusercontent.com/-XfoohbRo3Pw/WZ_6VszVVgI/AAAAAAAAABU/Yn0eiT7jKeswuSZfUMLBdRcIcuQH8yr5gCLcBGAs/s1600/plane.PNG)](https://lh3.googleusercontent.com/-XfoohbRo3Pw/WZ_6VszVVgI/AAAAAAAAABU/Yn0eiT7jKeswuSZfUMLBdRcIcuQH8yr5gCLcBGAs/s1600/plane.PNG)

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [August 25, 2017, 7:33pm UTC](https://community.cesium.com/t/velocityorientationproperty-cesium-czml/5986/2 "2017-08-25T19:33:11Z")

</div>

Hi there,

[This thread](https://groups.google.com/forum/#!searchin/cesium-dev/velocityorientationproperty%7Csort:relevance/cesium-dev/3u4nMD_emiw/k0Rljb0cAwAJ) discusses [VelocityOrientationProperty](https://cesiumjs.org/Cesium/Build/Documentation/VelocityOrientationProperty.html) and a workaround to getting to work with just CZML. There’s a lot of information there, hopefully you can find what you need.

Thanks,

Gabby

---

<div class="post-metadata">

**Author:** ![frodrigues.vexiza](https://avatars.discourse-cdn.com/v4/letter/f/958977/32.png) [@frodrigues.vexiza](https://community.cesium.com/u/frodrigues.vexiza)\
**Post date:** [August 28, 2017, 8:37am UTC](https://community.cesium.com/t/velocityorientationproperty-cesium-czml/5986/3 "2017-08-28T08:37:50Z")

</div>

Hi,  
Thanks for the reply. I think I have got. I leave my code here to share it.

viewer.dataSources.add(Cesium.CzmlDataSource.load(czml)).then(function(ds) {

var entity = ds.entities.getById(‘path’);

viewer.trackedEntity = entity;

var property = new Cesium.SampledPositionProperty();

for (var i = 0; i \< listCoord.length; i++) {

var position = new Cesium.Cartesian3.fromDegrees(listCoord[i].long, listCoord[i].lat, listCoord[i].altitud);

property.addSample(listCoord[i].time, position);

}

entity.orientation = new Cesium.VelocityOrientationProperty(property),

entity.position.setInterpolationOptions({

interpolationDegree : 1,

interpolationAlgorithm : Cesium.LinearApproximation

});

});

``

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [August 28, 2017, 9:26pm UTC](https://community.cesium.com/t/velocityorientationproperty-cesium-czml/5986/4 "2017-08-28T21:26:52Z")

</div>

Awesome, looks good. Glad you got it to work, and thanks for the example!
