Simple Camera Stuff

I am n00b hear me r0ar. Sorry for the stupid question. I have a scene that loads a table in the middle (0,0,0). Id like to have a camera circle around it. Also at one point in the code, I’d like to be able to set the camera right on top of the table looking at the other end. Any clues or ideas? I know the circling will take a task which I am comfortable with but I just dont understand these camera things. Here is what I have so far.

import direct.directbase.DirectStart
from direct.task import Task
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.gui.OnscreenText import OnscreenText
import math

#Load Table
table = loader.loadModel("models/table")
table.reparentTo(render)
table.setScale(0.05, 0.05, 0.05)
table.setPos(0,0,0)

#Start
run()

I know its not much. I have been messing around with the hello world program and others but I can seem to get it working. The table is always out of view. Any help would be greatly appreciated.

I haven’t tested it, but something like this should work.

import direct.directbase.DirectStart
from direct.task import Task
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.gui.OnscreenText import OnscreenText
import math

#Load Table
table = loader.loadModel("models/table")
table.reparentTo(render)
table.setScale(0.05, 0.05, 0.05)
table.setPos(0,0,0)

#Disable default camera controls
base.disableMouse()

#Setup a dummy node for the camera to rotate around
dummy = render.attachNewNode("dummy")
base.camera.reparentTo(dummy)

#Offset it and look at the dummy
base.camera.setY(10)
base.camera.lookAt(dummy)

#Make it rotate
base.camera.hprInterval(10.0, (360, 0, 0)).loop()

#Start
run()