camera controls question.

hi everyone I am really new to panda but i did manage to get the tutorials working. Anyways, I was looking at the roaming ralph tutorial and I was wondering how you would be able to use the keyboard controls to manipulate the camera to rotate up like making your avatar look up at the sky.

I somewhat understand how they made ralph rotate from left or right, but it is beyond me how to make the camera rotate up. I also did some searching and found that it has something to do with the get or set Hpr, but i have no clue how to implement it.

If someone can show me a simple sample code to achieve this, I would be grateful!

thanks a bunch.

The ‘p’ of Hpr stands for pitch, and refers to rotating up and down. (As opposed to ‘h’, which is what you usually change in Hpr: this stands for heading, and refers to rotating left and right).

If you make your code change the middle value of the camera’s Hpr triple, you will be rotating your camera to look up into the sky or down into the ground.