I use the code here exactly as it is on the tutorial:
panda3d.org/manual/index.php … _the_Panda
And it runs just fine, I start it and I see the panda walking on the ground. The camera angle is nice (i.e. not ‘above’ or ‘below’ the ground, spins slowly, etc.)
Now… say if I want to remove the spinning. i tried a few things, and now I’m rather confused about how camera angles work.
The first thing I tried was to remove the line:
This stops the spinning, as I expected, it also makes the starting camera angle a little wierd. Here’s a screenshot of what I see:
So the camera is slightly below the ground, panda is going off the screen and so on. I guess this must be some kind of ‘default’ camera position and angle.
I liked the initial camera position set by spinCameraTask. That’s the camera positionw here you are zoomed out and looking down at the panda. I just wanted to remove the spinning.
From my understanding of how spinCameraTask works, task.time starts at 0 and increases. That value is used to calculate the camera position. Since circular functions (sin or cos) are used you get spinning.
So I commented out this line:
and added this code
Basically copied from spinCameraTask with “task.time” replaced by “0”.
The result is that when I run the program, it looks exactly the same as the above screenshot.
If I replace “task.time” with any other number, it’s exactly the same.
Why does it seem like I’m unable to set the camera position manually? I understand that spinCameraTask was ran every frame to update the camera angle. But all I need is a way to set the camera angle once at the start of the program.
What am I doing wrong?