match blender camera to away3dlite

20 views
Skip to first unread message

George Profenza

unread,
Nov 27, 2009, 11:40:04 AM11/27/09
to away3d.dev
Hi,

I'm trying to match the camera settings from blender in away3d.

Blender's camera main property is Lens as far as I can see.

Camera3D in away3d has focus and zoom.
No fov, or anything else

How can I match the away3d camera with the blender one ?
I am using away3dlite, but I see there is a lenses package in the
away3d api.
Any starting points ?

Thanks,
George

Rob Bateman

unread,
Dec 9, 2009, 9:58:14 PM12/9/09
to away3...@googlegroups.com
Hey George

In Away3d, the camera class comes with its fov property which should work as expected to set the vertical fov in degrees. Also, to match the perspective projection of the blender view i would use Perspectivelens instead of the default. If you play with the fov values, you should be able to get a perfect match

Rob
--
Rob Bateman
Flash Development & Consultancy

rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com

George Profenza

unread,
Jan 5, 2010, 1:39:56 PM1/5/10
to Away3D.dev
Hi Rob,

Thanks for the input.

I've looked at camera properties a bit.
As far as I can see:

FP10 fieldOfView(in PerspectiveProjection) is equivalent to camera.fov
in away3d and equivalent to Camera.angle in Blender Python
FP10 focalLength(in PerspectiveProjection) is equivalent to
camera.focus in away3d and equivalent to Camera.lens in Blender Python

Here are the relevant API links:
FP10:
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/PerspectiveProjection.html
Away3D:
http://away3d.com/livedocs/away3d/cameras/Camera3D.html
Blender:
http://www.blender.org/documentation/249PythonDoc/Camera.Camera-class.html

I have attached my current setup here:

http://groups.google.com/group/away3d-dev/web/georgeprofenza_blender2Away3DSetup.zip

The zip contains image screenshots, a blender scene, a small python
snippet that prints numbers to the console
and the test .as file.

What am I missing ? The camera and objects seem to be in the right
position, not so sure about blender camera lens and angle
matching up with Away3D's camera focus and fov.

Any input to get me unstuck will help,
I'll tinker away in 3d meantime :)

> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com

George Profenza

unread,
Jan 5, 2010, 1:40:22 PM1/5/10
to Away3D.dev

George Profenza

unread,
Jan 30, 2010, 12:51:00 PM1/30/10
to Away3D.dev
Hello,

I've managed to get a closer match from a Blender scene to an Away3d
scene.

Here is a screenshot of how close I got:
http://i984.photobucket.com/albums/ae330/orgicus/blender2awayCamera.gif

The white WireframeMaterial cube is from Away3D, the background is a
default render
from Blender.

I've uploaded a simplified version of my test filed (.as, .fla, .jpg
(for tracing), .blend and .py)
here:
http://groups.google.com/group/away3d-dev/web/georgeprofenza_blender2Away3DSetupSimple.zip

At this point, I'm just using a camera facing forward a cube. I've
played with the z and fov properties
to match the look than used the numbers to change the script. I have
tested the view
with a cube with no rotation at all, and then the view with the cube
rotated by 45 degrees on Y in Away3D
and it matches the Blender look close enough.

At this point, it is not exact science, I'm just tinkering, but
hopefully I can get this to be useful.

Rob and Dennis,
Thanks for the input at LFPUG.

All the best,
George

On Jan 5, 6:40 pm, George Profenza <orgi...@gmail.com> wrote:
> Hi Rob,
>
> Thanks for the input.
>

> I've looked atcameraproperties a bit.


> As far as I can see:
>
> FP10 fieldOfView(in PerspectiveProjection) is equivalent tocamera.fov
> in away3d and equivalent toCamera.angle inBlenderPython
> FP10 focalLength(in PerspectiveProjection) is equivalent tocamera.focus in away3d and equivalent toCamera.lens inBlenderPython
>
> Here are the relevant API links:

> FP10:http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/PerspectiveP...
> Away3D:http://away3d.com/livedocs/away3d/cameras/Camera3D.htmlBlender:http://www.blender.org/documentation/249PythonDoc/Camera.Camera-class...


>
> I have attached my current setup here:
>

> http://groups.google.com/group/away3d-dev/web/georgeprofenza_blender2...
>
> The zip contains image screenshots, ablenderscene, a small python


> snippet that prints numbers to the console
> and the test .as file.
>

> What am I missing ? Thecameraand objects seem to be in the right
> position, not so sure aboutblendercameralens and angle
> matching up with Away3D'scamerafocus and fov.


>
> Any input to get me unstuck will help,
> I'll tinker away in 3d meantime :)
>
> On Dec 10 2009, 2:58 am, Rob Bateman <rob.bate...@gmail.com> wrote:
>
> > Hey George
>

> > In Away3d, thecameraclass comes with its fov property which should work as


> > expected to set the vertical fov in degrees. Also, to match the perspective

> > projection of theblenderview i would use Perspectivelens instead of the


> > default. If you play with the fov values, you should be able to get a
> > perfect match
>
> > Rob
>
> > On Fri, Nov 27, 2009 at 4:40 PM, George Profenza <orgi...@gmail.com> wrote:
> > > Hi,
>
> > > I'm trying to match thecamerasettings fromblenderin away3d.
>

> > >Blender'scameramain property is Lens as far as I can see.


>
> > > Camera3D in away3d has focus and zoom.
> > > No fov, or anything else
>

> > > How can I match the away3dcamerawith theblenderone ?

Rob Bateman

unread,
Feb 2, 2010, 4:07:09 PM2/2/10
to away3...@googlegroups.com
Hey George

looks pretty close! looking at your code, you should probably try just adjusting the zoom property of the camera after you have applied the perpspectivelens object - this should give you the full range of possible projections with the lens, and as long as your z distance is correct (which looks like a difficult calc as well) you should be able to hit hte same projection exactly. let me know how you get on

cheers

Rob
rob.b...@gmail.com
www.infiniteturtles.co.uk
www.away3d.com
Reply all
Reply to author
Forward
0 new messages