ROm222

28-Mar-07, 19:21

Please help!

I am trying to determine the target position (view position) of a Blender Camera so I do this:

cam = Blender.Object.Get("Camera")

loc = cam.loc # Camera Position

rot = cam.rot # Camera Rotation in Euler Angle

# rot[0] = rot[0] * RAD_TO_DEG # Convert Euler To Degree

# rot[1] = rot[1] * RAD_TO_DEG # Convert Euler To Degree

# rot[2] = rot[2] * RAD_TO_DEG # Convert Euler To Degree

# Then I calculate the camera view position by doing this:

loc[0] = loc[0] + (1.0 - math.cos( rot[0] ) )

loc[1] = loc[1] + (1.0 - math.cos( rot[1] ) )

loc[2] = loc[2] + (1.0 - math.cos( rot[2] ) )

The result obviously doesn't seems to work.... what Im doing wrong!?

Tks in advance,

Cheers,

I am trying to determine the target position (view position) of a Blender Camera so I do this:

cam = Blender.Object.Get("Camera")

loc = cam.loc # Camera Position

rot = cam.rot # Camera Rotation in Euler Angle

# rot[0] = rot[0] * RAD_TO_DEG # Convert Euler To Degree

# rot[1] = rot[1] * RAD_TO_DEG # Convert Euler To Degree

# rot[2] = rot[2] * RAD_TO_DEG # Convert Euler To Degree

# Then I calculate the camera view position by doing this:

loc[0] = loc[0] + (1.0 - math.cos( rot[0] ) )

loc[1] = loc[1] + (1.0 - math.cos( rot[1] ) )

loc[2] = loc[2] + (1.0 - math.cos( rot[2] ) )

The result obviously doesn't seems to work.... what Im doing wrong!?

Tks in advance,

Cheers,