Hi, I am a newbie in Panda3d. I was learning how to load model and change the camera view. So, I have the following code,
class MyApp(ShowBase):
def __init__(self):
ShowBase.__init__(self)
self.disableMouse()
self.Box = self.loader.loadModel("Box.dae",noCache=True)
self.Box.reparentTo(self.render)
self.Box.setScale(1.0)
self.Box.setPos(0, 0, 0)
self.camera.setPos(0, 0, 25)
self.camera.lookAt(self.Box)
print(self.camera.getPos())
print(self.camera.getHpr())
app = MyApp()
app.run()
So, when I run the code, I could see one side of the box. So far so good.
But whenever, I change the camera position to camera.setPos(25,0,0) I found the model has undergone a rolling motion of 90 degree. This implies that the camera went through a rolling motion.
As you can see that I am retrieving camera Hpr, so in the first case the output is LVecBase3f(0, -90, 0), and in the 2nd case the output is LVecBase3f(90, 0, 0).
As per my understanding the camera.setPos should not produce a roll,pitch or yaw motion to the camera.
What I am missing here.
Thanks in advance.