Resize final image, not View3d.

Software: Away3D 4.x

3pstation, Newbie
Posted: 22 January 2016 11:57 AM   Total Posts: 11

Hello, guys! Can you please advice how and where i can find solution for my case.
I use starling+away3d. Lets say i have background image with red squares in Starling and some 3d objects on top layer:

http://screencast.com/t/9q7kbchEIP

Than i want to resize scene like this:

http://screencast.com/t/b8V4prWgj

So there are no proportional resizing, just filling the all free space.

With Starling no problem, i need just to change stage3DProxy.width and stage3DProxy.height, but how do same with Away3d i don’t know.

View3d#width and View3d#height works in different way that i need, it resize view and keep proportions, and it’s correct. But i need incorrect way of resizing in Away3d view, i need resize “as is” without any proportions, so all objects will over the red squares all the time(like in second screen).

Thank you!

   

rdoi, Member
Posted: 22 January 2016 07:40 PM   Total Posts: 86   [ # 1 ]

Just a quick idea:

Render the away scene to a texture (Stage3DProxy.setRenderTarget()) , then use the texture in a (scaled) starling image.

   

3pstation, Newbie
Posted: 23 January 2016 02:29 PM   Total Posts: 11   [ # 2 ]

Yeah, good idea. Thanks.

   

3pstation, Newbie
Posted: 24 January 2016 07:44 AM   Total Posts: 11   [ # 3 ]

No ))) Bad idea for me, because i need mouse interaction with 3d objects.

   

Yann, Newbie
Posted: 26 January 2016 09:59 PM   Total Posts: 16   [ # 4 ]

Hello,
I’m a beginner but I think that the component which actually control the way you see 3D object is the camera. And more specifically the lens.
Try something like camera.lens.matrix.appendScale(scaleX,ScaleY,ScaleZ). I don’t know if it will help you but it’s an idea.

   

Tempy111, Sr. Member
Posted: 27 January 2016 10:07 AM   Total Posts: 133   [ # 5 ]

Just looking at this.. I think it is a Camera lens issue. The stage and everything you see is via the Camera, or atleast should be. If you are not using a Camera, look into it and add it first. It gives you far more control over what is viewed and how.

   

rdoi, Member
Posted: 02 February 2016 07:57 PM   Total Posts: 86   [ # 6 ]

Considering the away render to texture approach, if you need some mouse events over the away scene, yes its a bit tricky.

I believe you will have to deal the mouse event by yourself.
Get the mouse event from starling image, then “transpose” to the away scene by casting your own picking collider.

Or you may consider tinkering the away default MouseManager (inside the view) to accept some transformation before process its mouse handling workflow (that happens during view.render).

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X