can't set camera position

No matter how I change the coordinate of camera.setPos(x,y,z), my viewpoint seems to be fixed at the origin. I’m really confused… Need help. Thanks!

import direct.directbase.DirectStart

class World:
 
    def __init__(self):
 
        #Load the environment model.
        self.ground = loader.loadModel("models/Ground2.egg")
        self.sky = loader.loadModel("models/sky.egg")
        # Reparent the model to render.
        self.ground.reparentTo(render)
        #Apply scale and position transforms on the model.
        self.ground.setScale(5, 5, 5)
        self.ground.setPos(0, 0, -7)
        self.sky.reparentTo(render)
        #Apply scale and position transforms on the model.
        self.sky.setScale(1, 1, 1)
        self.sky.setPos(0, 0, 0)

        self.building = loader.loadModel("models/building.egg")
        self.building.reparentTo(render)
        self.building.setScale(0.2, 0.2, 0.2)
        self.building.setPos(25,100,-5)
        

        camera.setPos(0, 0, 100)
        base.camera.reparentTo(render)
        
w = World()
run()

You need to call base.disableMouse() first to turn off the trackball object that will otherwise constantly reset your camera position to the trackball control position.

David

Yes…I see. Thank you.