Hi,
Anyone got any pointers on keeping an object (cube) which I have at the same size in true pixels as the Away3D 4.x view/scene resizes itself on browser/window resize?
My goal is to resize a cube to an exact width and height which is specified in xml (so this is variable). I have hard coded this for full screen 1920x1080 but it would be nice so that I could match the pixel width of the 2D item when someone resizes the browser and not have the 3D element scale or undercale.
Is there an equation that I can obtain to maintain an objects size no matter what width and height the view becomes?
Process flow:
1. So my cube’s dimensions are initially 128x64
2. On cube selection it moves forward 800px
3. The cube’s pixel size is measured in photoshop as 2D is 530x265
4. Get xml target sizes - which are 640x480
5. Find % scale of cube so that it would match 2D object of 640x480
(TargetWidth/5.3)/100; // For width
(TargetHeight/2.65)/100; // For height
6. Tween scaleX & Y of the cube targetX & Y using equation above.
7. PROBLEM: Screen resolution is not 1920x1080, equation no longer works as cube at stage 3 is no longer 530x265 and the act of measuring it’s 2D size is manual process…?
Any ideas?
Thanks
Darcey