[SOLVED] Parented (camera -> target) : banking the camera

Animation tools, character animation, non linear animation

Moderators: jesterKing, stiv

Post Reply
Gorgo13
Posts: 0
Joined: Mon Jan 29, 2007 4:50 am
Location: Mitaka, Tokyo

[SOLVED] Parented (camera -> target) : banking the camera

Post by Gorgo13 » Tue Jan 30, 2007 7:12 am

Hi, I'm a new blender user!

Here is a question I've posted on the CGTalk blender forum a few days ago. There doesn't seem to have a straightforward answer, nor this being possible at all... I got some answers, but noone doing exactly what I wanted.

I experienced problems with parenting a camera tracked to a target. I create an Empty object (CameraAim, the camera aim), I track the camera to the CameraAim. Then I create another Empty (GlobalCameraSet) which is the parent to the Camera and the CameraAim.

GlobalCameraSet
.CameraAim
.Camera
->Constrained to CameraAim

I'd like to bank the camera along the line of sight (i.e. along the Camera->CameraAim direction). I've tried to rotate the GlobalCameraSet empty object, but it's not working because the camera vector is always pointing up (z direction). Is that a known limitation of Blender or is there a way to overcome this problem? (i.e. to define a local "up" vector which can be banked perpendicularly to the line of sight)

Thanks again for your help.
Last edited by Gorgo13 on Fri Feb 02, 2007 10:59 am, edited 1 time in total.

kitsu
Posts: 0
Joined: Sun Jun 06, 2004 8:08 am

Post by kitsu » Tue Jan 30, 2007 6:19 pm

parent the camera to an empty that is tracking a target. That way the camera will go with the empty and copy its orientation, but you can then add changes to the camera too.

Gorgo13
Posts: 0
Joined: Mon Jan 29, 2007 4:50 am
Location: Mitaka, Tokyo

Post by Gorgo13 » Fri Feb 02, 2007 9:20 am

Hi kitsu, thanks for the reply.

It's working thanks!... but I have a little trouble understanding the relationship between the parented and the child object: consider an object "child" is parented to another object "parent". If parent's coordinates are {1;1;1}, and if child's coordinates are {0;0;0}, where is child located? (it should be at parent's exact location, no?)

I guess it has to deal with the original relative positions of child and parent objects at the moment when you create the relationship.

kitsu
Posts: 0
Joined: Sun Jun 06, 2004 8:08 am

Post by kitsu » Fri Feb 02, 2007 6:24 pm

Parenting is like making the parents local coordinates the global coordinates of the child. This means that when you move/rotate/scale a child it is moving in its own world with the parent at its center. If you move the parent the child just makes sure it is in the same location/orientation to the center of its world at all times.

So for your scenario it is as if the child's center is located at <-1,-1,-1> relative to its world (= its parent). Now if you move the parent around the child's coords will still be <-1,-1,-1>. The only time they will change is if you move the child :o

For more useful info like this be sure to visit the users forum: www.blenderartists.org
:wink:

Gorgo13
Posts: 0
Joined: Mon Jan 29, 2007 4:50 am
Location: Mitaka, Tokyo

Post by Gorgo13 » Sat Feb 03, 2007 4:39 am

Yes, I understand the parent/child relationship, but let me describe one situation: I had a child object parented to an Empty. The Emtpy had its coordinates {5;0;0}, but when the child's coordinates were set to {0;0;0} then I ended up with the child located at coordinate {1;0;0} compared to Emtpy. How come? Shouldn't the child's location be exactly at its parent location when child coordinates are {0;0;0} (from what you described, that's how I understand it should be)?
Or is that a bug?

Thanks.

kitsu
Posts: 0
Joined: Sun Jun 06, 2004 8:08 am

Post by kitsu » Sat Feb 03, 2007 7:28 pm

How are you setting the locations? If you are setting them using the 'n' properties panel you should know AFAIK those coords are the objects global location.

Actually I don't know of any way to specify absolute coordinates in an objects local coordinate system? Maybe the Python Blender.Object.Object.DlocX/Y/Z properties would do this, but I don't know if they respect parent relationships?

If you really wanted to move something to a specific location relative to its parent I would suggest shift-s>snap cursor to location on the parent, then select the object and shift-s>snap selection to cursor. From there move and type in relative coords during the move (e.g. g-x-1)...

I was kind of surprised that clearing the child objects location (alt-g) didn't move it to the center of the parent if that isn't where it was parented. I guess there is some initial offset built in? I guess the objects new local coordinate system is generated at its own center, but then linked to the parent? That would explain why it would jump back to its origonal position relative to the parent.

Gorgo13
Posts: 0
Joined: Mon Jan 29, 2007 4:50 am
Location: Mitaka, Tokyo

Post by Gorgo13 » Sun Feb 04, 2007 3:09 am

kitsu wrote:How are you setting the locations? If you are setting them using the 'n' properties panel you should know AFAIK those coords are the objects global location.
The indicated coordinates do not seem to be related to something "coherent": as I said, if I input {0;0;0} for the child, it didn't jump to the global origin, but somewhere near the parent (at global coordinate {4;0;0} actually according to the modeler views).
kitsu wrote:If you really wanted to move something to a specific location relative to its parent I would suggest shift-s>snap cursor to location on the parent, then select the object and shift-s>snap selection to cursor. From there move and type in relative coords during the move (e.g. g-x-1)...
Yes I see, but in general I like to know where my objects are located precisely, sometimes it helps.
I was kind of surprised that clearing the child objects location (alt-g) didn't move it to the center of the parent if that isn't where it was parented. I guess there is some initial offset built in? I guess the objects new local coordinate system is generated at its own center, but then linked to the parent? That would explain why it would jump back to its origonal position relative to the parent.
Lightwave has a "toggleable" option "parent in place": if on, then the parented object stays at its current location, but when turned off, it jumps to the center of the parent object. Maybe a similar kind of parenting option could be helpful.

All in all, this is kind of confusing, and I'd like to figure that out :)

Post Reply