Away3D Forum http://away3d.com/forum/ Away3D Forum en Copyright 2013 2013-05-18T22:09:44+00:00 strange behaviour after moving project to Flash Builder 4.7 http://away3d.com/forum/viewthread/4503/ http://away3d.com/forum/viewthread/4503/#When:22:09:44Z <p>After creating a new mobile AIR IOS (IPad) project in 4.7 with files from 4.6 I am baffled by what I see.</p> <p>I have a number of meshes exported from Prefab as classes which are now invisible when loaded. The trace tool reports visible=true on all of them but nothing appears in the view.<br /> I also have a skybox and a ground plane which do a strange disappearance ritual. Whichever is added to the stage LAST is visible—whichever is first doesn’t appear at all.</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">skyBx</span><span style="color: #007700">:</span><span style="color: #0000BB">SkyBox</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">SkyBox</span><span style="color: #007700">(</span><span style="color: #0000BB">cubeTexture</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">scene</span><span style="color: #007700">.</span><span style="color: #0000BB">addChild</span><span style="color: #007700">(</span><span style="color: #0000BB">skyBx</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />var&nbsp;</span><span style="color: #0000BB">plane</span><span style="color: #007700">:</span><span style="color: #0000BB">Mesh&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">PlaneGeometry</span><span style="color: #007700">(</span><span style="color: #0000BB">50000</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">50000</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">waterMaterial</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">plane</span><span style="color: #007700">.</span><span style="color: #0000BB">geometry</span><span style="color: #007700">.</span><span style="color: #0000BB">scaleUV</span><span style="color: #007700">(</span><span style="color: #0000BB">200</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">plane</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">50</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">scene</span><span style="color: #007700">.</span><span style="color: #0000BB">addChild</span><span style="color: #007700">(</span><span style="color: #0000BB">plane</span><span style="color: #007700">);&nbsp;</span> </span> </code></div> <p>I don’t know where to begin looking for answers. Perhaps something is missing in the project parameters—like the proper compiler string. I have entered</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">locale&nbsp;en_US&nbsp;</span><span style="color: #007700">-</span><span style="color: #0000BB">swf</span><span style="color: #007700">-</span><span style="color: #0000BB">version</span><span style="color: #007700">=</span><span style="color: #0000BB">15&nbsp;</span> </span> </code></div> <p>or perhaps I haven’t installed the AIR SDK properly.</p> <p>Any suggestions?</p> 2013-05-18T22:09:44+00:00 Camera third person http://away3d.com/forum/viewthread/4500/ http://away3d.com/forum/viewthread/4500/#When:15:28:13Z <p>Welcome<br /> At first sorry for my bad english!</p> <p>I was rendered map (img) of the guy that moves from point A to B. The guy is a MovieClip 2D, because I do not know how to do animation legs. There is a special class converted to sprite3d and then added to the scene.</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">czlowieczek&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">TimelineAnimation</span><span style="color: #007700">(</span><span style="color: #0000BB">czlowiek1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">spriteCzlowiek&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Sprite3D</span><span style="color: #007700">(</span><span style="color: #0000BB">czlowieczek</span><span style="color: #007700">.</span><span style="color: #0000BB">material</span><span style="color: #007700">,</span><span style="color: #0000BB">20</span><span style="color: #007700">,</span><span style="color: #0000BB">50</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">spriteCzlowiek</span><span style="color: #007700">.</span><span style="color: #0000BB">x&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">spriteCzlowiek</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">50</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">spriteCzlowiek</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">3000</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">_view</span><span style="color: #007700">.</span><span style="color: #0000BB">scene</span><span style="color: #007700">.</span><span style="color: #0000BB">addChild</span><span style="color: #007700">(</span><span style="color: #0000BB">spriteCzlowiek</span><span style="color: #007700">);&nbsp;</span> </span> </code></div> <p><br /> And now my question: how do the camera followed the l people (third person camera) and smoothly curved the corners<br /> Until the turn I can set the camera:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">spriteCzlowiek</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">&lt;&nbsp;-</span><span style="color: #0000BB">550</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;&nbsp;spriteCzlowiek</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">+=&nbsp;&nbsp;</span><span style="color: #0000BB">10</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">_view</span><span style="color: #007700">.</span><span style="color: #0000BB">camera</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">spriteCzlowiek</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">-&nbsp;</span><span style="color: #0000BB">300</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">}&nbsp;</span> </span> </code></div> <p>But, right?<br /> I tried <strong>camera.rotationY</strong> but it does not go smoothly<br /> Please help me</p> 2013-05-18T15:28:13+00:00 Zooming textures http://away3d.com/forum/viewthread/4482/ http://away3d.com/forum/viewthread/4482/#When:18:07:22Z <p>Hello,</p> <p>I am very new to Away3D, so I ask your patience with my ignorance.</p> <p>First I would like to say that I am very impressed by the Away3D project and I am extremely grateful to all the contributors.</p> <p>I am trying to make a globe that supports extensive zooming. The approach I have used in a simple 2D version of my project is to split the image into multiple tiles (3600 in this case) and then use JavaScript to load (swap out the image url) higher resolution jpegs for the tiles that are visible and load low res jpegs for the tiles that are <em>not</em> visible (to save memory). </p> <p>The further in the user zooms, the fewer tiles are visible but are in higher resolution. When the user zooms out, more tiles are visible but loaded with lower resolution.</p> <p>Is there a way to do something similar with a sphere in Away3D?</p> <p>Thanks in advance for your patience and help!</p> 2013-05-13T18:07:22+00:00 How can I generate a smooth soft shadow, e.g from a cube? http://away3d.com/forum/viewthread/1646/ http://away3d.com/forum/viewthread/1646/#When:07:10:38Z <p>Hi,</p> <p>how can a generate a soft and smooth shadow from an object3d with a light source?</p> <p>Thanks<br /> Edgar</p> 2011-12-31T07:10:38+00:00 TextureMaterial alpha,view3d error? http://away3d.com/forum/viewthread/4499/ http://away3d.com/forum/viewthread/4499/#When:02:25:36Z <p>When I set the material’s alpha,the opacity is wrong</p> <p>If I // the alpha,it’s correct, i can also set alphaThreshold to make it looks ok.</p> <p>Please see the attachments <img src="/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /><br /> The plane’s left is looks wrong(see away3d.jpg,away3d2.jpg),the plane’s right is looks correct(see away3d3.jpg).</p> <p>But I need the alpha,I have no idea how to make it see correct!So I need someones’s help!Thank you!</p> <p>I used with away3d-core-fp11_4_1_1_Beta<br /> ......<br /> [Embed(source=“assets/movie.png”)]<br /> var Face:Class;</p> <p>var viewport:View3D = new View3D(scene,camera,null);<br /> viewport.backgroundColor = 0xffffff;<br /> addChild(viewport);<br /> viewport.antiAlias = 4;<br /> ......<br /> var fogMethod:FogMethod=new FogMethod(0, 2000, 0xffffff);<br /> var pp:TextureMaterial=new TextureMaterial(Cast.bitmapTexture(Face))<br /> pp.repeat=true<br /> pp.bothSides=true<br /> pp.alpha=0.98<br /> pp.addMethod(fogMethod);</p> <p>var _plane:Mesh = new Mesh(new PlaneGeometry(1000, 50,20,1), pp);<br /> _plane.pickingCollider = PickingColliderType.AS3_FIRST_ENCOUNTERED;<br /> _plane.mouseEnabled = true;&nbsp; <br /> _plane.geometry.scaleUV(20,1)<br /> scene.addChild(_plane);<br /> ......</p> 2013-05-18T02:25:36+00:00 Mouse interaction is “off” by scale of sprites holding the View3D…(?) http://away3d.com/forum/viewthread/4498/ http://away3d.com/forum/viewthread/4498/#When:16:22:12Z <p>Maybe this has been addressed before - if so I’d really appreciate being pointed in the right direction!</p> <p>I’m trying to upgrade the StrikeSapphire game code base from Away3d 3.6 to 4.1.1 right now, which is a pretty large undertaking. The site has a custom windowing system in Flash, similar to ASWing, that lets players have more than one game window open at a time, move them and resize them. Window.content is a sprite which in this case is filled with a class that extends View3D.</p> <p>What’s apparent from testing is that if a View3D in 4.x is a child of a Sprite, resizing the Sprite doesn’t scale the view (which is fine, it’s easy enough to adjust width/height on the view). However, scaling the holding Sprite <em>does</em> scale the mouse interaction areas. Even if the View is then resized, the holding areas are off by a proportionally greater amount. example:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">...<br /></span><span style="color: #0000BB">view</span><span style="color: #007700">.</span><span style="color: #0000BB">width&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1000</span><span style="color: #007700">;<br />var&nbsp;</span><span style="color: #0000BB">s</span><span style="color: #007700">:</span><span style="color: #0000BB">Sprite&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Sprite</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">s</span><span style="color: #007700">.</span><span style="color: #0000BB">addChild</span><span style="color: #007700">(</span><span style="color: #0000BB">view</span><span style="color: #007700">);&nbsp;<br /></span><span style="color: #FF8000">//clickable&nbsp;areas&nbsp;are&nbsp;lined&nbsp;up&nbsp;perfectly&nbsp;over&nbsp;objects&nbsp;in&nbsp;the&nbsp;view.<br /></span><span style="color: #0000BB">s</span><span style="color: #007700">.</span><span style="color: #0000BB">scaleX&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">s</span><span style="color: #007700">.</span><span style="color: #0000BB">scaleY&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1.3</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//or&nbsp;by&nbsp;setting&nbsp;width/height<br />//visible&nbsp;3D&nbsp;elements&nbsp;stay&nbsp;the&nbsp;same&nbsp;size,&nbsp;but...<br />//clickable&nbsp;areas&nbsp;are&nbsp;now&nbsp;off&nbsp;to&nbsp;the&nbsp;right&nbsp;and&nbsp;down&nbsp;by&nbsp;30%.<br /></span><span style="color: #0000BB">trace&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">view</span><span style="color: #007700">.</span><span style="color: #0000BB">width</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//1000.&nbsp;Correct.&nbsp;We&nbsp;did&nbsp;not&nbsp;expect&nbsp;it&nbsp;to&nbsp;scale.<br /></span><span style="color: #0000BB">trace&nbsp;</span><span style="color: #007700">(</span><span style="color: #0000BB">s</span><span style="color: #007700">.</span><span style="color: #0000BB">width</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//1300.&nbsp;Which&nbsp;is&nbsp;odd&nbsp;since&nbsp;the&nbsp;view&nbsp;isn't&nbsp;any&nbsp;larger.<br /></span><span style="color: #007700">...&nbsp;</span> </span> </code></div> <p>setting the width/height on the view after this does nothing to alleviate the problem; the mouse enabled areas <em>also</em> scale when the view is resized. So they stay 30% of the total view size off from where they’re supposed to be. </p> <p>The same effect seems to happen if you hit Cmd+/Cmd- in Firefox to zoom the Flash player size. Again, it’s not a problem if the context3d doesn’t scale, but then the mouse hit areas shouldn’t be scaling either, right?</p> <p>So is this a bug, or… am I missing something? It seems to make it impossible to use 4.x in a windowing-in-Flash environment or even in a browser other than as a single, full-screen game.</p> 2013-05-17T16:22:12+00:00 Animation driven locomotion http://away3d.com/forum/viewthread/4495/ http://away3d.com/forum/viewthread/4495/#When:14:42:33Z <p>Hi,</p> <p><br /> Quick question here. First though I’d like to congrat on getting AWD 2.1, Away3D 4.1 and AwayBuilder one step closer to full release. These 3 are awesome !</p> <p><br /> Onto the question, does the animation system in Away3D support animation driven locomotion ? I’m not saying this should be a priority, I don’t know, there are so many things I’m eager to see added, but I’m curious about ADL nonetheless.</p> <p><br /> For readers curious about what this is, you can read more <a href="http://www.gdcvault.com/play/1015387/Animation-Driven-Locomotion-for-Smoother">here</a>.</p> 2013-05-17T14:42:33+00:00 Flexible terrain generation http://away3d.com/forum/viewthread/4496/ http://away3d.com/forum/viewthread/4496/#When:15:03:53Z <p>Hi, </p> <p>I would like to know the current capabilities of Away3D in terms of terrain generation.</p> <p>I know of a couple ways to generate terrain:<br /> - Using heightmaps, it’s fast but not flexible, and kind of boring and repetitive anyway.<br /> - Using actual meshes, it’s very flexible but might be overkill, and possibly you cannot make large landscapes easily for performance reasons (or can you ?).</p> <p><br /> Recently I found a third way to generate terrain. It’s from the Phyre Engine and <a href="http://develop.scee.net/files/presentations/cedec2008/PhyreEngine_CEDEC2008Speech_e.pdf">is described here</a> (PDF back from 2008, the engine must have evolved since then).</p> <p><br /> I don’t know the official name of that technique, but based on what I read from the paper I’ll call it “High order surface terrain generation”.</p> <p><br /> Just read the overview part of the paper for a general idea in terms of terrain “features”. Every single point listed in the Goals subsection is exactly what I am looking for.</p> <p><br /> Can Away3D allow me to do that currently ?</p> <p>If yes, could you hint me on how ?<br /> If not, do you think I can reasonably hope to see it added within the next 3 months ? 6 ? 12 ? Unlikely any time soon ?</p> <p><br /> Thanks a bunch !</p> 2013-05-17T15:03:53+00:00 Object proximity and mouse interaction http://away3d.com/forum/viewthread/4489/ http://away3d.com/forum/viewthread/4489/#When:02:33:41Z <p>I’m creating an adventure game and there are some objects in the scene and mouse interaction. The problem is that I need the mouse to be active only when I’m near the object, not always (if the object is 1000px away for example, it should be inactive). any idea? Thanks.</p> 2013-05-16T02:33:41+00:00 queueSnapshot not working since yesterday in chrome with fp11.7 http://away3d.com/forum/viewthread/4484/ http://away3d.com/forum/viewthread/4484/#When:17:42:39Z <p>view.background = null;<br /> view.render ();<br /> view.renderer.queueSnapshot (camerasData.getInstance().screenshotcameraDATA);<br /> view.render ();<br /> &nbsp; <br /> camerasData.getInstance().screenshotcameraBMP.bitmapData =camerasData.getInstance().screenshotcameraDATA;<br /> camerasData.getInstance().screenshotcameraBMP.smoothing = true;<br /> &nbsp; <br /> camerasData.getInstance().screenshottoSend = new BitmapData (512, 512, true, 0x00000000);<br /> camerasData.getInstance().screenshottoSend.draw (camerasData.getInstance().screenshotcameraBMP);<br /> &nbsp; <br /> addChild (new Bitmap (camerasData.getInstance().screenshottoSend));</p> <p>Since yesterday the last line doen’t display anything in chrome (pc) fp11.7, yesterday i was working with fp11.3</p> <p><br /> Any solution?</p> 2013-05-14T17:42:39+00:00