Forum: Poser - OFFICIAL


Subject: Oh python GODS! Is it possible.....

shadownet opened this issue on Nov 21, 2004 ยท 134 posts


stewer posted Sun, 21 November 2004 at 3:47 PM

" I think the length should really be based on crow-flies distance from current camera," Correct. Here's how to calculate the focal length to get the currently selected object in focus (in PNU):

import poser, math

scene = poser.Scene()
actor = scene.CurrentActor()
cam = scene.CurrentCamera()

p1 = actor.WorldDisplacement()
p2 = cam.LocalDisplacement()
p3 = actor.Origin()
d = (-p3[0] + p2[0]-p1[0], -p3[1] + p2[1]-p1[1], -p3[2] + p2[2]-p1[2])
mag = math.sqrt (d[0]*d[0] + d[1]*d[1] + d[2]*d[2])