how to adjust the camera tilt angle

Hi,

I don't want to use mouse to control the camera tilt angle,so I put it away

"viewer.scene.screenSpaceCameraController.tiltEventTypes = undefined;"

Then I want to use keyboard to control it. But I can't do that like mouse.

I just want to set some fixed angles by the keyboard,What should I do?

Best,
Anseru

Hi Anseru,

You can add some custom camera keyboard events as detailed in our camera tutorial: http://cesiumjs.org/tutorials/Camera-Tutorial/

You’ll probably want to use camera.LookUp, which takes a rotation angle in radians.

Here’s the sandcastle example with example code:

Hope that helps,

  • Rachel

在 2017年4月20日星期四 UTC+8上午1:20:47,Rachel Hwang写道:

Hi Anseru,

You can add some custom camera keyboard events as detailed in our camera tutorial: http://cesiumjs.org/tutorials/Camera-Tutorial/
You'll probably want to use camera.LookUp, which takes a rotation angle in radians.

Here's the sandcastle example with example code:
http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Camera%20Tutorial.html&label=Showcases

Hope that helps,
- Rachel

On Wednesday, April 19, 2017 at 6:10:11 AM UTC-4, anser...@gmail.com wrote:Hi,
I don't want to use mouse to control the camera tilt angle,so I put it away
"viewer.scene.screenSpaceCameraController.tiltEventTypes = undefined;"
Then I want to use keyboard to control it. But I can't do that like mouse.
I just want to set some fixed angles by the keyboard,What should I do?
Best,
Anseru

Hi Rachel,

I want to tilt,just like Cesium.CameraEventType.MIDDLE_DRAG. The Camera rotation can't do that.

Best,
Anseru

Were you able to find a way of titling the camera using the keyboard in the same way it does with the mouse?

I think one way to do this is to fix the camera’s reference frame at a point, then use the camera rotate functions. Here’s a Sandcastle example orbitting a point on a line.

This thread has a similar question and some more Sandcastle code examples to do it:

https://groups.google.com/d/msg/cesium-dev/599qxodhdWo/ruQ_nyh-BgAJ

Is this what you had in mind?