How do I make a camera point in a certain direction?

I need to know this so I can continue making my project. c:

Look at point:


Look in direction of vector:

camera.lookAt(camera.getPos() + vector)

If you have angles that you want to use, then you can treat the camera like any other NodePath, I believe:

camera.setHpr(hAngle, pAngle, rAngle)

# Or




Like rdb and Thaumaturge stated, you can control your camera by calling the lookAt() method or the setHpr() method. Here is an example of setting a camera’s position away from the panda model, and making it look at the panda:

from direct.showbase.ShowBase import ShowBase

class MyApp(ShowBase):
    def __init__(self):

        self.panda = loader.loadModel("models/panda-model")
        self.panda.setPos(0, 0, 0), -1000, 0)

app = MyApp()

In this case, is the camera NodePath. I recommend using ‘camera’ if you’re using DirectBase and ‘’ if you’re using ShowBase like I am.