Thats not as hard as it looks, simply create a dummy node on the models position, attach the camera to it and rotate the dummy node. Make sure you make the camera look at the model each frame ( camera.lookAt(self.model) ) by adding it you your rotation task.
from pandac.PandaModules import *
from direct.directbase import DirectStart
from direct.gui.DirectGui import *
from direct.interval.IntervalGlobal import *
class Viewer(DirectObject):
def __init__(self):
base.disableMouse()
self.accept('escape',sys.exit)
self.accept('o', base.oobe)
self.model = loader.loadModel('panda-model.egg')
self.model.reparentTo(render)
self.model.setScale(0.05)
self.dummy = NodePath('')
self.dummy.reparentTo(render)
camera.reparentTo(self.dummy)
camera.setPos(0,-150,70)
taskMgr.add(self.task,'task')
rotate = LerpHprInterval(self.dummy, 60, Point3(360, 0, 0), startHpr=Point3(0, 0, 0))
rotate.loop()
def task(self,task):
camera.lookAt(self.model)
v = Viewer()
run()