Why can’t I set the position of the camera?
But if I add it to taskMgr, it will run successfully
from direct.showbase.ShowBase import ShowBase
from panda3d.core import Texture
class World(ShowBase):
def __init__(self):
super().__init__()
self.camera.setPos(0, 10, 0)
self.camera.reparentTo(self.render)
self.model = self.load_model('smodels/pan.egg')
self.model.reparentTo(self.render)
self.model.setPos(0, 20, 0)
def load_model(self, path):
model = self.loader.loadModel(path)
textures = model.findAllTextures()
for texture in textures:
texture.setMagfilter(Texture.FTNearest)
texture.setMinfilter(Texture.FTNearest)
return model
app = World()
app.run()