how move along the terrain surface in the direction the camera is facing, in the same height

hello,

I need little help here.

I’m trying to handle camera using keyboard.

I’ve seen the sandcastle example available on https://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Camera%20Tutorial.html

What I want to do is:

When I press the UP/DOWN arrow it should move along the terrain surface in the direction the camera is facing in the same height.

And if I press Shift key + UP/DOWN the globe should rotate in the same way.

I’m using Cesium 1.50.

Thank you.

Are you having any specific trouble doing this?

For the globe rotating, you might want to look at setting a reference frame for the camera here: https://groups.google.com/d/msg/cesium-dev/iPrtSDyPyjs/phNJs2voCAAJ

For the height, you should be able to get the height of the terrain with viewer.scene.globe.getHeight() and use that to position the camera.