# TrackedEntity vs EntityView

**URL:** <https://community.cesium.com/t/trackedentity-vs-entityview/35742>\
**Category:** CesiumJS\
**Created:** [October 11, 2024, 6:29am UTC](https://community.cesium.com/t/trackedentity-vs-entityview/35742 "2024-10-11T06:29:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tedfire](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tedfire/32/14000_2.png) [@tedfire](https://community.cesium.com/u/tedfire)\
**Post date:** [October 11, 2024, 6:29am UTC](https://community.cesium.com/t/trackedentity-vs-entityview/35742/1 "2024-10-11T06:29:36Z")

</div>

Hi,

I have a 3d Terrain map and a path and a 3D model in GLB all this works great if I use trackedEntity (v1.122). However the camera is locked and the user cant rotate round the model. So Instead I use the following …

```
        const planeEntity = viewer.entities.add({
            availability: new Cesium.TimeIntervalCollection([new Cesium.TimeInterval({
                start: startTime,
                stop: stopTime
            })]),
            position: position,
            orientation: adjustedOrientation, // Use the adjusted orientation
            model: {
                uri: 'https://xxxxxxx/3d/Airtractor4.glb', // Plane model URI
                scale: 1.0
            },
            path: {
                resolution: 1, // Smoothness of the path
                material: new Cesium.PolylineGlowMaterialProperty({
                    glowPower: 0.1,
                    color: Cesium.Color.YELLOW
                }),
                width: 10
            }
        });

         // Remove the trackedEntity assignment
        // viewer.trackedEntity = planeEntity;

        console.log(planeEntity);

        // Set up an EntityView to follow the plane
        const entityView = new Cesium.EntityView(planeEntity, viewer.scene, viewer.scene.mapProjection.ellipsoid);

        // Update the camera to follow the plane
        viewer.scene.preRender.addEventListener(function (scene, time) {
            if (planeEntity.isAvailable(time)) {
                entityView.update(time);
            }
        });

        // Optionally, adjust the camera offset
        entityView.offset3D = new Cesium.Cartesian3(-500.0, -500.0, 300.0); 

```

The path loads and the timeline is running but there is NO planeEntity model visible?  
The console.log seems to indicate that the planeEntity is available at the time the entityView is being created.

Any suggestions please as I’m totally stuck !

Many Thanks  
Ted

---

<div class="post-metadata">

**Author:** ![Luke\_McKinstry](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/luke_mckinstry/32/25557_2.png) [@Luke\_McKinstry](https://community.cesium.com/u/Luke_McKinstry)\
**Post date:** [October 15, 2024, 8:23pm UTC](https://community.cesium.com/t/trackedentity-vs-entityview/35742/4 "2024-10-15T20:23:59Z")

</div>

Hi @tedfire ,  
Thanks for your post, welcome to the Cesium community, and apologies for the delay in getting back to you.

I don’t think it is expected behavior for `trackedEntity` to “lock” the camera. Perhaps looking at this sandcastle example [Cesium Sandcastle](https://sandcastle.cesium.com/?src=CZML%20Path.html) could be a useful demonstrates for how to use trackedEntity while still being able to maneuver the camera relative to the model as it moves along a path. The linked example uses a czml instead of a glb, but the behavior of trackedEntity is the same for both types.

Please let us know if there is behavior you are seeking to get that is not covered in the example and we would be happy to continue to help.  
Thanks,  
Luke

---

<div class="post-metadata">

**Author:** ![tedfire](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/tedfire/32/14000_2.png) [@tedfire](https://community.cesium.com/u/tedfire)\
**Post date:** [October 16, 2024, 8:17am UTC](https://community.cesium.com/t/trackedentity-vs-entityview/35742/5 "2024-10-16T08:17:50Z")

</div>

Hi Luke, thanks for coming back to me. Yes you are right ! I went through multiple iterations of code and later found that the camera was no longer locked using trackedEntity ! I must have done something daft ! trackedEntity turned out to be perfect and I can orbit around the model no problem. Thanks for the heads up !
