camera positions

Hey

I have just started working on using the game engine. I have created a sphere that can move. but I want the camera to be able to rotate and zoom on the ball. I cant figure out how to make the camera rotate around the ball and not around the axis or the camera’s center.

please help!!

Froginblender

  1. select the sphere, shift-s, cursor-selection
  2. spacebar, add empty (e.g. at that location)
  3. with empty highlighted: shift-select sphere, ctrl-p, make parent
  4. select camera, shift-select empty
    5)ctrl-p, make parent
    now the empty will move with the sphere, and the camera will rotate around the empty… let me know if you have any question :wink:

for zoom in: just copie this file… very easy

http://www.blendenzo.com/Files/Demos…meraZoom.blend
(scroll to zoom)

good luck!

When I make the empty parent to the ball it wants to rotate with the ball making the camera rotate with it. I don’t know how to fix this.

froginblender

Follow this tutorial:
http://www.blendenzo.com/tutVertexParenting.html

It will answer your question. However, the camera will not rotate by itself. The player will have to rotate it manually. I haven’t figured out a way around this yet.

that is not what I meant, I want to be able to rotate the camera around the ball using arrow keys. and follow the ball at the same time

froginblender

Yes, it is what you meant. You’re just not applying the knowledge that you already have.

  1. Add an empty at the center of the ball.
  2. Vertex parent the empty to the ball. (This is what my tutorial teaches you)
  3. Parent the camera to the empty by the normal parenting method.
  4. Set up the empty to rotate with the arrow keys.

This should work. If it doesn’t, it is because of a bug related to vertex parenting, not because the method is wrong. Let me know if it does not work.

ok so far so good

i can rotate up and down no problem, but when I rotate left and right I must be in a view parallel to the plain that the ball is siting on in order to get the camera to rotate staying at the same hight above the plain.

I hope this makes sense. and I hope you have an answer

@blendenzo- very cool, I didn’t know there was such as thing as vertex parenting, thanks for sharing.

if the vertex parenting doesn’t work (for some reason, i dont know) we could just use a simple python script that’s what I usually do before I heard of vertex parenting, the python would be:

empty.setPosition(sphere.getPosition())

this will copy the position but not the rotation… I’ve used it before…