Since the thing I need is exactly distanceFromCamera you mean I should
do this:
var distanceFromCamera = cube.width /
(Math.tan((PerspectiveLens(view.camera.lens).fieldOfView * 0.5) *
Math.PI / 180) * 2)
?
and then
camera.position = new Vector3D(0,0,distanceFromCamera)
?
Anyway I tried the code you posted but (despite that I imported the
PerspectiveLens package) I keep getting this error:
Main_VideoCubeAway3D.as, Line 34 1119: Access of possibly undefined
property fieldOfView through a reference with static type
away3d.cameras.lenses:PerspectiveLens.
If it helps I'm using a TargetCamera3D and Away3D version 3