[away3DLite] problem with proper scale when "applicationDomain.getDefinition" is used

16 views
Skip to first unread message

farmazone

unread,
Sep 15, 2009, 4:34:03 AM9/15/09
to away3d.dev
Hello,

In "Pixel Precision" discussion I stumbled accross behavior I don't
understand.

So main problem is that when I load a class from a library swf into a
shell swf I cannot use :

loader.contentLoaderInfo.applicationDomain.getDefinition("My3DClass")
as Class;

because whole view is very small. It looks like away3dLite can't
resolve proper stageWidth and stageHeight.
But when I just create an instance by adding loader to main root -
everything works.

In loaded swf I have the same metatag [SWF(width...] as in the shell
swf. So I am sure that both swfs are exactly the same.

I need to create instance by getDefinition.

Any tips?

katopz

unread,
Sep 15, 2009, 5:24:26 AM9/15/09
to away3...@googlegroups.com
try trace stage w/h, camera fov,zoom,focus to see what so diff there
btw did you use Template? if yes plz try override in stage init
function for stage w/h

also try do thing after Event.ADDED_TO_STAGE

hth


--
katopz
http://www.sleepydesign.com

farmazone

unread,
Sep 15, 2009, 5:57:02 AM9/15/09
to away3...@googlegroups.com

traces the same values.

I use Template but there are no references to stage width or height in
Template class. just set view.x=0 but no success.
I got deeper into View class , and form within that class from
function "updateScreenClipping" , _stageWidth is always the same.

Ok . I got clue. I traced perspectiveProjection from Camera3D class.

when an instance is created by "applicationDomain.getDefinition",
root.transform.perspectiveProjection of loaded class is different from
that from shell swf

focalLength is much smaller and projectionCenter is in different
point. So I think something here causes problem.

Rob Bateman

unread,
Sep 20, 2009, 10:29:17 AM9/20/09
to away3...@googlegroups.com
Hey farmazone

this is most likely caused by the root property being set locally for a loaded swf. this is a problem for the projection matrix, because the calculations need to be done internally based on perceived screenWidth values (yes, i know this is a property of stage, but it seems to be affected somehow...), i have a feeling this will not be calculated in the same way for a local swf file.

it may be worth logging an issue in the issues tracker for this. of you can include a sample file that illustrates the problem, it will help us fix things faster!

http://code.google.com/p/away3d/issues/list

cheers

Rob
--
Rob Bateman
Flash Development & Consultancy

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