frustum + fov handling

36 views
Skip to first unread message

pascual

unread,
Apr 22, 2008, 5:58:39 AM4/22/08
to away3d.dev
Hello list,

Just getting started to evaluate the existing 3d flash solutions for
some kind of shared augmented reality application.

Away3d has everything we need except for the camera that strangely
does not integrate the notion of viewport and fov (as it is in sandy
and pv3d). Since we need to do camera matching with real pictures/
videos and third party 3d software this is mandatory for us to have a
direct acces to viewport and fov params.

I also noticed that a couple of messages about this issue were
unanswered on this forum.

Is there any reason this camera type was not implemented in away 3D or
just not needed on your side ?

thanks

Rob Bateman

unread,
Apr 22, 2008, 7:42:20 AM4/22/08
to away3...@googlegroups.com
Hey Pascual

currently an Away3d view instance will default it's viewport (ie. clipping window) to the edges of the screen.

In order to define a clipping viewport smaller than the screen, you have to manually set the clipping property on the view like so:

view.clip = new RectangleClipping(-100, -100, 100, 100);

this culls triangles outside the clipping view, but you'll still want to mask the edges to provide a clean view boundary. In the case of a simple rectangle mask, this can be done with a scrollRect:

view.scrollRect = new Rectangle(-100, -100, 200, 200);


fov is not a property that exists natively in the camera, but is it fairly easy to calculate (example below is for a fov of 45 degrees):

var fov:Number = 45;
var fov2:Number = (fov/2) * (Math.PI/180);
var tan:Number = Math.tan(fov2);
camera.zoom = width/(2*tan*camera.focus);

where width is the width of you view clipping window


a fov setter should be added to the Away3d camera class in the next revision


atb


Rob
--
Rob Bateman
Flash Development & Consultancy

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

pascual

unread,
Apr 22, 2008, 1:52:21 PM4/22/08
to away3d.dev
Hi Rob thanks for your quick answer.

What about the focus param ? Is it related to camera focal length ?

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

Rob Bateman

unread,
Apr 22, 2008, 2:43:54 PM4/22/08
to away3...@googlegroups.com
Hey Pascual

the focus parameter is a bit of a misnomer - it doesn't actually represent focus in the "physical lens focus" sense

what it does is adjust depth of field - ie. how perspective is applied. focus is a divisor for the z depth of a vertex, therefore, as focus goes, up, depth of field goes down. Extremely high values of focus result in an orthographic projection

atb

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

pascual

unread,
Apr 23, 2008, 5:03:32 AM4/23/08
to away3d.dev
ok Rob,

By the way how to access the sources of your demos (especially the one
with extrudes) ?
It seems there are not in the svn repo.

thanks

On Apr 22, 11:43 am, "Rob Bateman" <rob.bate...@gmail.com> wrote:
> Hey Pascual
>
> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com

Rob Bateman

unread,
Apr 23, 2008, 6:54:47 AM4/23/08
to away3...@googlegroups.com
Hi Pascual

do you mean the demos in our tutorial pages? We are aiming to include all of these in the svn, but as you can imagine the process is quite time consuming. as soon as we can, well start adding them to the svn and zip downloads

atb

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

Fabrice

unread,
Apr 23, 2008, 7:51:28 AM4/23/08
to away3...@googlegroups.com
look under tutorials on the site..
added a Lathe tut already... and more tutorials are coming.

SegmentsExtrude, SkinExtrude were updated in last 2 days. Check your
svn.

PathExtrude was deleted, because it was by mistake in the trunk. Its
not finished yet.

Fabrice

pascual

unread,
Apr 23, 2008, 8:13:28 AM4/23/08
to away3d.dev
Hey Rob,

I just wanted to evaluate the code for this demo:

http://away3d.com/away3d-extrudes-2

Dis I miss the link that points to it ?

Since interactive modeling is the first stage of our app this one
would give me a nice overview
of what's possible in term of dynamic mesh construction with away3D
for now.

The fact is I just have a couple of days to evaluate the 3 apis to
take a final decision and without the demo code it is quite difficult
for me
to quickly get a concrete vision of the inner working of the features
I am the most interrested in.

thanks for your help
> rob.bate...@gmail.comwww.infiniteturtles.co.ukwww.away3d.com

pascual

unread,
Apr 23, 2008, 8:24:58 AM4/23/08
to away3d.dev
oops Fabrice, sorry I did not see your message

ok, I'll take a quick look at it

regards
Reply all
Reply to author
Forward
0 new messages