I would just use the good-old distance formula and do it all in expression
syntax. It’s verbose, but doing it in Python will likely be even more so, and
this will run a hell of a lot faster:
sqrt(pow(Cam.translate.x-Axis.translate.x, 2) +
pow(Cam.translate.y-Axis.translate.y, 2) +
pow(Cam.translate.z-Axis.translate.z, 2))
-Nathan
From: Adam Hazard
Sent: Thursday, February 28, 2013 11:42 AM
To: Nuke user discussion
Subject: [Nuke-users] calculating distance between axis and camera in
anexpression
Hi,
I am trying to calculate the distance between an axis and a 3D camera in an
expression. But I have several problems and not sure where to begin.
I was using this as a guideline from nukepedia, but planning to swap in Vector3
pointA = nuke.math.Vector2(50,100)
pointB = nuke.math.Vector2(150, 175)
distance = pointA.distanceBetween(pointB)
print distance
But I am guessing I need to call python in the expression? But none of the
python syntax worked either.
Also how would I assign an animated camera as a vector variable
...Vector3(parent.Camera.translate.x, parent.Camera.translate.y,.....etc?
Or am I just totally off in the wrong direction?
hopefully this is possible
Thanks.
Adam
--------------------------------------------------------------------------------
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users