Position of entity does not change while the cursor is moving

Hi,

I want to bind the entity position to the mouse cursor position:

    _cursoreEntity = null;
    handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
    handler.setInputAction(function (movement) {
        var cartesian = viewer.camera.pickEllipsoid(movement.endPosition, viewer.scene.globe.ellipsoid);

        if (_cursoreEntity == null) {
            _cursoreEntity = _viever.entities.add({
                position: cartesian,
                ellipsoid: {
                    radii: new Cesium.Cartesian3(0.5, 0.5, 0.5),
                    material: Cesium.Color.RED
                }
            });
        } else {
            _cursoreEntity.position = cartesian;
        }

    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

But, the entity position is updated only when the mouse movement stops. How update position of entity during mouse movement?

Cesium 1.35, Chrome

Hi there,

If you check out our Picking example in Sandcastle, we do something very similar to what you describe with a label entity. It updates during mouse movement, so hopefully you can find a way to implement your desired behavior in that example.

Thanks!

Gabby

Thank you. Instead ellipsoid I used billboard after that an entity slides behind the cursor when moving.

Awesome, glad it helped!