I’m having trouble placing the camera. I had it working at one point, and now it’s just inside the model. I’ve been scratching my head trying things for about 2 hours now, and I just can’t see what I’m missing. Maybe you brilliant cats can help!
I have a sky dome that should be visible ala PiratePanda’s sky dome script ([Sky Sphere Script)). When I do not specify a camera, I can see the sky dome.
When I specify a camera (lines 40-44) at any coords, I’m inside the spaceship model and the skydome is not visible.
I messed around with the code last night and by adding “base.disableMouse()” I was able to achieve what you’re asking for. Have you tried changing the distance you are setting the camera to? I tried several different values and each seemed to give the expected result. This is the camera setup code:
# Camera code, follow the ship
self.camera = base.camera
self.camera.reparentTo(self.m)
self.camera.setPos(self.m, 0, -400, 10)
Changing the -400 to different values should change the position of the camera in relation to the model.
Okay, you’re right - I got it now. It’s working, although I don’t see what’s different. Maybe putting it in the instance of the class, with self.camera = base.camera?
/shrug/
Okay, moving on to learning how to use a dummy node to make a smoother camera follow.