Hi,
I figured out how to get my camera half working how I want it to.
First here is what it does.
I take the camera and disable the mouse so I can mess with it. I then reparent it to a dummy model and tell the camera to look at that model. I do this so it rotates around that model because I want the camera to rotate around 0,0,0 coordinates of the word where the model is located.
I then set a task for the camera to continue to look at the model and then reactivate the mouse.
However what the camera does is always starts off inside the model.
So heres the problem:
Camera starts inside the model its looking at and I can not set it outside the model since the look at command is called through the task manager every frame and it keeps resetting it inside the model until the mouse is moved to move the camera outside.
Sooo I’ve spent 3 days on this issue and can not figure out a way to get the camera start outside the model instead of inside it.
Code for my camera:
#disable the mouse and reparent it to the dummy with an offset to Y to see the planet
#then look at the planet with the camera
base.disableMouse()
base.camera.reparentTo(dummy)
base.camera.lookAt(dummy)
#Call task to make the camera continue to look at the planet
taskMgr.add(exampleTask, 'MyTaskName', extraArgs=[dummy], appendTask=True)
#Set the task to look at the model every frame
def exampleTask(model, a):
base.camera.lookAt(model)
return Task.cont
Thats the first problem so if anyone can let me know of how to go about getting the camera to first display outside the model (so on load the user does not need to scroll out to see the model)
Second problem is:
It just really akward to control the damn camera. I’m looking for if your in a 3d modeling program you can rotate round the 0,0,0 axis and zoom in and out and around.
However the camera does not do this its just plain akward you zoom in but it goes in and to the left etc.
I cant explain it so if you know how to setup a camera to do this that be great!
Thanks for any input/help!