Away3D Forum http://away3d.com/forum/ Away3D Forum en Copyright 2017 2017-09-08T10:04:21+00:00 How to apply a texture inside a CylinderGeometry http://away3d.com/forum/viewthread/6259/ http://away3d.com/forum/viewthread/6259/#When:07:48:31Z <p>I am using the following code to apply a texture on a CylinderGeometry</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">_plane&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">CylinderGeometry</span><span style="color: #007700">(</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">100</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">200</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">64</span><span style="color: #007700">,</span><span style="color: #0000BB">1&nbsp;</span><span style="color: #007700">,</span><span style="color: #0000BB">false</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">),&nbsp;new&nbsp;</span><span style="color: #0000BB">TextureMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Cast</span><span style="color: #007700">.</span><span style="color: #0000BB">bitmapTexture</span><span style="color: #007700">(</span><span style="color: #0000BB">FloorDiffuse</span><span style="color: #007700">)));<br /></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">_plane</span><span style="color: #007700">);&nbsp;</span> </span> </code></div> <p>This code is applying the texture on the outside of the cylinder. Is there any way I can apply the texture to the inside surface of the CylinderGeometry?</p> 2017-09-07T07:48:31+00:00 How can we extract the animation of a web game Unity 3d .AWD http://away3d.com/forum/viewthread/6249/ http://away3d.com/forum/viewthread/6249/#When:16:05:51Z <p>I live in Vietnam, Currently I have a problem is a file v_file.awd contains the animation of a web game that I play, I do not know how to unpack it or open with what software. I hope you can help me to extract this file and exploit the resources from them (I mod Counter-Strike game) (I at the link: <a href="http://upthink.wap.sh/files/v_shovel">http://upthink.wap.sh/files/v_shovel</a>[1].awd) <a href="http://upthink.wap.sh/images/untitled.JPG">http://upthink.wap.sh/images/untitled.JPG</a>). I need to be able to covert out .obj ... Looking forward to helping me. Thank you</p> 2017-06-20T16:05:51+00:00 How to render two mesh in different projections simultaneously at the same time? http://away3d.com/forum/viewthread/6248/ http://away3d.com/forum/viewthread/6248/#When:01:38:35Z <p>Question</p> 2017-06-17T01:38:35+00:00 How to render a plane in orthogonal, and a figure in a perspective projection? http://away3d.com/forum/viewthread/6247/ http://away3d.com/forum/viewthread/6247/#When:07:35:17Z <p>How to render a plane in orthogonal, and a figure in a perspective projection?</p> <p>This code not work.</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">package</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;&nbsp;&nbsp;OpenFL&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">display</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">events</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">geom</span><span style="color: #007700">.</span><span style="color: #0000BB">Point</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">geom</span><span style="color: #007700">.</span><span style="color: #0000BB">Rectangle</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">text</span><span style="color: #007700">.</span><span style="color: #0000BB">TextField</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">text</span><span style="color: #007700">.</span><span style="color: #0000BB">TextFieldAutoSize</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">text</span><span style="color: #007700">.</span><span style="color: #0000BB">TextFormat</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">text</span><span style="color: #007700">.</span><span style="color: #0000BB">TextFormatAlign</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">Assets</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">Lib</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;openfl</span><span style="color: #007700">.</span><span style="color: #0000BB">geom</span><span style="color: #007700">.</span><span style="color: #0000BB">Vector3D</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">//&nbsp;&nbsp;&nbsp;Away3D&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">containers</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">entities</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">materials</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">primitives</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">utils</span><span style="color: #007700">.*;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">debug</span><span style="color: #007700">.</span><span style="color: #0000BB">AwayFPS</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">cameras</span><span style="color: #007700">.</span><span style="color: #0000BB">lenses</span><span style="color: #007700">.</span><span style="color: #0000BB">LensBase</span><span style="color: #007700">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">cameras</span><span style="color: #007700">.</span><span style="color: #0000BB">lenses</span><span style="color: #007700">.</span><span style="color: #0000BB">OrthographicLens</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">import&nbsp;away3d</span><span style="color: #007700">.</span><span style="color: #0000BB">cameras</span><span style="color: #007700">.</span><span style="color: #0000BB">lenses</span><span style="color: #007700">.</span><span style="color: #0000BB">PerspectiveLens</span><span style="color: #007700">;&nbsp;<br /><br />class&nbsp;</span><span style="color: #0000BB">Main&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">Sprite&nbsp;{<br />&nbsp;<br />&nbsp;</span><span style="color: #007700">private&nbsp;var&nbsp;</span><span style="color: #0000BB">_view</span><span style="color: #007700">:</span><span style="color: #0000BB">View3D</span><span style="color: #007700">;<br />&nbsp;private&nbsp;var&nbsp;</span><span style="color: #0000BB">_plane</span><span style="color: #007700">:</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">;<br />&nbsp;private&nbsp;var&nbsp;</span><span style="color: #0000BB">_plane2</span><span style="color: #007700">:</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">;<br />&nbsp;private&nbsp;var&nbsp;</span><span style="color: #0000BB">_plane3</span><span style="color: #007700">:</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">;<br /><br />&nbsp;public&nbsp;function&nbsp;new()&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;super</span><span style="color: #007700">();<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_view&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">View3D</span><span style="color: #007700">();<br />&nbsp;&nbsp;</span><span style="color: #0000BB">addChild</span><span style="color: #007700">(</span><span style="color: #0000BB">_view</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">camera</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">800</span><span style="color: #007700">;&nbsp;<br />&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">500</span><span style="color: #007700">;<br />&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">lookAt</span><span style="color: #007700">(new&nbsp;</span><span style="color: #0000BB">Vector3D</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;&nbsp;&nbsp;ORTHOGRAPHIC&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;//_view.camera.lens&nbsp;=&nbsp;new&nbsp;OrthographicLens();&nbsp;<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane&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">1024</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1024&nbsp;</span><span style="color: #007700">),&nbsp;<br />&nbsp;&nbsp;new&nbsp;</span><span style="color: #0000BB">TextureMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Cast</span><span style="color: #007700">.</span><span style="color: #0000BB">bitmapTexture</span><span style="color: #007700">(</span><span style="color: #DD0000">"assets/45.jpg"</span><span style="color: #007700">)));<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane</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;</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">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">220</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane</span><span style="color: #007700">.</span><span style="color: #0000BB">rotationX&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">30</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane2&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">1024</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1024</span><span style="color: #007700">),&nbsp;<br />&nbsp;&nbsp;new&nbsp;</span><span style="color: #0000BB">TextureMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Cast</span><span style="color: #007700">.</span><span style="color: #0000BB">bitmapTexture</span><span style="color: #007700">(</span><span style="color: #DD0000">"assets/56.jpg"</span><span style="color: #007700">)));<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane2</span><span style="color: #007700">.</span><span style="color: #0000BB">x&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1024</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane2</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane2</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">220</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane2</span><span style="color: #007700">.</span><span style="color: #0000BB">rotationX&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">30</span><span style="color: #007700">;<br />&nbsp;<br />&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;&nbsp;PERSPECTIVE&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;//_view.camera.lens&nbsp;=&nbsp;new&nbsp;PerspectiveLens();&nbsp;<br /><br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane3&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">512</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">512</span><span style="color: #007700">),&nbsp;<br />&nbsp;&nbsp;new&nbsp;</span><span style="color: #0000BB">TextureMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Cast</span><span style="color: #007700">.</span><span style="color: #0000BB">bitmapTexture</span><span style="color: #007700">(</span><span style="color: #DD0000">"assets/23.jpg"</span><span style="color: #007700">)));<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane3</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;</span><span style="color: #0000BB">_plane3</span><span style="color: #007700">.</span><span style="color: #0000BB">y&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane3</span><span style="color: #007700">.</span><span style="color: #0000BB">z&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">220.01</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_plane3</span><span style="color: #007700">.</span><span style="color: #0000BB">rotationX&nbsp;</span><span style="color: #007700">=&nbsp;-</span><span style="color: #0000BB">30</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&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">_plane&nbsp;</span><span style="color: #007700">);<br />&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">_plane2&nbsp;</span><span style="color: #007700">);<br />&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">_plane3&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #FF8000">//setup&nbsp;the&nbsp;render&nbsp;loop<br />&nbsp;&nbsp;</span><span style="color: #0000BB">addEventListener</span><span style="color: #007700">(</span><span style="color: #0000BB">Event</span><span style="color: #007700">.</span><span style="color: #0000BB">ENTER_FRAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_onEnterFrame</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">stage</span><span style="color: #007700">.</span><span style="color: #0000BB">addEventListener</span><span style="color: #007700">(</span><span style="color: #0000BB">Event</span><span style="color: #007700">.</span><span style="color: #0000BB">RESIZE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">onResize</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">onResize</span><span style="color: #007700">();<br />&nbsp;&nbsp;<br />&nbsp;</span><span style="color: #0000BB">}<br /><br />&nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">_onEnterFrame</span><span style="color: #007700">(</span><span style="color: #0000BB">e</span><span style="color: #007700">:</span><span style="color: #0000BB">Event</span><span style="color: #007700">):</span><span style="color: #0000BB">Void&nbsp;{<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;_view</span><span style="color: #007700">.</span><span style="color: #0000BB">render</span><span style="color: #007700">();<br />&nbsp;&nbsp;<br />&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">onResize</span><span style="color: #007700">(</span><span style="color: #0000BB">event</span><span style="color: #007700">:</span><span style="color: #0000BB">Event&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">):</span><span style="color: #0000BB">Void&nbsp;{<br />&nbsp;&nbsp;_view</span><span style="color: #007700">.</span><span style="color: #0000BB">width&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stage</span><span style="color: #007700">.</span><span style="color: #0000BB">stageWidth</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_view</span><span style="color: #007700">.</span><span style="color: #0000BB">height&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">stage</span><span style="color: #007700">.</span><span style="color: #0000BB">stageHeight</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;<br />}&nbsp;</span> </span> </code></div> 2017-06-16T07:35:17+00:00 loadermd5test &amp; class which extends EventDispatcher http://away3d.com/forum/viewthread/6239/ http://away3d.com/forum/viewthread/6239/#When:03:04:07Z <p>in away3d broomstick example, loadermd5test, if there are several animated mesh(several class which extends EventDispatcher), it didn’t work, why ? this message appear:</p> <p>Error: Error #2032: Stream Error. URL: app:/players/pg3/model.png<br /> at away3d.loaders::AssetLoader/onRetrievalFailed()<br /> at flash.events::EventDispatcher/dispatchEventFunction()<br /> at flash.events::EventDispatcher/dispatchEvent()<br /> at away3d.loaders.misc::SingleFileLoader/handleUrlLoaderError()<br /> at flash.events::EventDispatcher/dispatchEventFunction()<br /> at flash.events::EventDispatcher/dispatchEvent()<br /> at flash.net::URLLoader/onComplete()</p> <p>because of the MonsterEvent ? i am using loader instead of assetlibrary for different class which extends EventDispatcher<br /> can anyone help me solve this problem? any differences in coding by using different version of away3d? if yes, how ? now i am embedded all my enemies into the main file separate it with different loader<br /> please demonstrate it</p> 2017-06-01T03:04:07+00:00 3D to 2D coordinates conversion http://away3d.com/forum/viewthread/6238/ http://away3d.com/forum/viewthread/6238/#When:09:47:33Z <p>Hi friends.</p> <p>mesh.addEventListener( MouseEvent3D.MOUSE_DOWN, onObjectMouseDown );</p> <p>function(evt:MouseEvent3D) {<br /> trace(evt.uv);<br /> }</p> <p>I want the exact same result like ‘evt.uv’ but without using MouseEvent3D. HELP PLEASE !!!</p> 2017-05-30T09:47:33+00:00 Animation suspends when Gargbage Collector cleans the memory http://away3d.com/forum/viewthread/5372/ http://away3d.com/forum/viewthread/5372/#When:09:30:44Z <p>I use md5 models for animation. I noticed a small problem which can be serious enough for making a game on Away3d technology. When animation is started , memory consumption immediately begin to grow average 1 kb per each enterFrame call. I found no memory allocations in my code. Scout showed that this small memory allocations occur in a View3d.render chain (i.e. in Object3d.lookAt function).</p> <p>This would not be such a big poblem as Garbage Collector cleans the memory periodically. The problem is when GC cleans the memory, animation suspends for a second (iOS, PC)&nbsp; which will be not a pleasant surprise for gamer.</p> <p>Does anyone succeeded to escape such animation pauses on these constant GC memory cleans?</p> 2014-03-18T09:30:44+00:00 AnimationClipState making shared nodes dispatch PLAYBACK_COMPLETE events… http://away3d.com/forum/viewthread/6222/ http://away3d.com/forum/viewthread/6222/#When:05:39:37Z <p>Hi, I noticed that I had some weird things happening when attaching listeners to SkeletonClipNode for PLAYBACK_COMPLETE event.</p> <p>I quickly realized that when triggering the event for one animated mesh, ALL the listeners across the cloned meshes were called.</p> <p>That’s when I took a look at the animator.clone function that I understood:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">public&nbsp;function&nbsp;clone():</span><span style="color: #0000BB">IAnimator<br />{<br />&nbsp;</span><span style="color: #FF8000">/*&nbsp;The&nbsp;cast&nbsp;to&nbsp;SkeletonAnimationSet&nbsp;should&nbsp;never&nbsp;fail,&nbsp;as&nbsp;_animationSet&nbsp;can&nbsp;only&nbsp;be&nbsp;set<br />&nbsp;&nbsp;through&nbsp;the&nbsp;constructor,&nbsp;which&nbsp;will&nbsp;only&nbsp;accept&nbsp;a&nbsp;SkeletonAnimationSet.&nbsp;*/<br />&nbsp;</span><span style="color: #007700">return&nbsp;new&nbsp;</span><span style="color: #0000BB">SkeletonAnimator</span><span style="color: #007700">(</span><span style="color: #0000BB">_animationSet&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">SkeletonAnimationSet</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_skeleton</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_forceCPU</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">}&nbsp;</span> </span> </code></div> <p>You don’t clone the animation set…</p> <p>Now I couldn’t help but notice that classes that implement IAnimator are also event dispatchers…</p> <p>So I modified this code in AnimationClipState…<br /> Before:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">notifyPlaybackComplete</span><span style="color: #007700">():</span><span style="color: #0000BB">void<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;_animationClipNode</span><span style="color: #007700">.</span><span style="color: #0000BB">dispatchEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">_animationStatePlaybackComplete&nbsp;</span><span style="color: #007700">||=&nbsp;new&nbsp;</span><span style="color: #0000BB">AnimationStateEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">AnimationStateEvent</span><span style="color: #007700">.</span><span style="color: #0000BB">PLAYBACK_COMPLETE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_animator</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_animationClipNode</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">}&nbsp;</span> </span> </code></div> <p>After:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">notifyPlaybackComplete</span><span style="color: #007700">():</span><span style="color: #0000BB">void<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;_animationStatePlaybackComplete&nbsp;</span><span style="color: #007700">||=&nbsp;new&nbsp;</span><span style="color: #0000BB">AnimationStateEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">AnimationStateEvent</span><span style="color: #007700">.</span><span style="color: #0000BB">PLAYBACK_COMPLETE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_animator</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">this</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_animationClipNode</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">_animator&nbsp;is&nbsp;IEventDispatcher</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(</span><span style="color: #0000BB">_animator&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">IEventDispatcher</span><span style="color: #007700">).</span><span style="color: #0000BB">dispatchEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">_animationStatePlaybackComplete</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">_animationClipNode</span><span style="color: #007700">.</span><span style="color: #0000BB">dispatchEvent</span><span style="color: #007700">(</span><span style="color: #0000BB">_animationStatePlaybackComplete</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">}&nbsp;</span> </span> </code></div> <p>And now I just add my PLAYBACK_COMPLETE listener to the animator instead of doing it for every single animation node…</p> 2017-05-04T05:39:37+00:00 Error: A Material instance cannot be shared across renderables with different animator libraries http://away3d.com/forum/viewthread/6221/ http://away3d.com/forum/viewthread/6221/#When:08:18:08Z <p>Hi,</p> <p>I’m having a weird problem whem loading several animated meshes into the game…</p> <p>Here’s the code called on ASSET_COMPLETE:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">onMD5ResourceComplete</span><span style="color: #007700">(</span><span style="color: #0000BB">$e</span><span style="color: #007700">:</span><span style="color: #0000BB">AssetEvent</span><span style="color: #007700">):</span><span style="color: #0000BB">void<br />{<br />&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">node</span><span style="color: #007700">:</span><span style="color: #0000BB">SkeletonClipNode</span><span style="color: #007700">;<br />&nbsp;var&nbsp;</span><span style="color: #0000BB">animator</span><span style="color: #007700">:</span><span style="color: #0000BB">SkeletonAnimator</span><span style="color: #007700">;<br />&nbsp;var&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">:</span><span style="color: #0000BB">IAsset&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$e</span><span style="color: #007700">.</span><span style="color: #0000BB">asset</span><span style="color: #007700">;<br />&nbsp;var&nbsp;</span><span style="color: #0000BB">name</span><span style="color: #007700">:</span><span style="color: #0000BB">String&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetNamespace</span><span style="color: #007700">;<br />&nbsp;var&nbsp;</span><span style="color: #0000BB">animation_set</span><span style="color: #007700">:</span><span style="color: #0000BB">SkeletonAnimationSet</span><span style="color: #007700">;<br /><br />&nbsp;</span><span style="color: #0000BB">LightLogger</span><span style="color: #007700">.</span><span style="color: #0000BB">log</span><span style="color: #007700">(</span><span style="color: #DD0000">"onMD5ResourceComplete&nbsp;"&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">name&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #DD0000">"&nbsp;"&nbsp;</span><span style="color: #007700">+&nbsp;</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType</span><span style="color: #007700">);<br /><br />&nbsp;if&nbsp;(</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">AssetType</span><span style="color: #007700">.</span><span style="color: #0000BB">ANIMATION_SET</span><span style="color: #007700">)<br />&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;animation_set&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">asset&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">SkeletonAnimationSet</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">animator&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">SkeletonAnimator</span><span style="color: #007700">(</span><span style="color: #0000BB">animation_set</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]</span><span style="color: #007700">.</span><span style="color: #0000BB">skeleton</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]</span><span style="color: #007700">.</span><span style="color: #0000BB">mesh</span><span style="color: #007700">.</span><span style="color: #0000BB">animator&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">animator</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_md5ReadyRope</span><span style="color: #007700">.</span><span style="color: #0000BB">cutFiber</span><span style="color: #007700">(</span><span style="color: #0000BB">name</span><span style="color: #007700">);<br />&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;</span><span style="color: #007700">else&nbsp;if&nbsp;(</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">AssetType</span><span style="color: #007700">.</span><span style="color: #0000BB">SKELETON</span><span style="color: #007700">)<br />&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">_md5Meshes[name]&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">{}</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]</span><span style="color: #007700">.</span><span style="color: #0000BB">skeleton&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">asset&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">Skeleton</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;</span><span style="color: #007700">else&nbsp;if&nbsp;(</span><span style="color: #0000BB">asset</span><span style="color: #007700">.</span><span style="color: #0000BB">assetType&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">AssetType</span><span style="color: #007700">.</span><span style="color: #0000BB">MESH</span><span style="color: #007700">)<br />&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">_md5Meshes[name]&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">{}</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]</span><span style="color: #007700">.</span><span style="color: #0000BB">mesh&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">asset&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">Mesh</span><span style="color: #007700">;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">_md5Meshes[name]</span><span style="color: #007700">.</span><span style="color: #0000BB">mesh</span><span style="color: #007700">.</span><span style="color: #0000BB">castsShadows&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">}<br />}&nbsp;</span> </span> </code></div> <p>And here’s the logged result:</p><div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">onMD5ResourceComplete&nbsp;Sleepy</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;geometry<br />onMD5ResourceComplete&nbsp;Sleepy</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;mesh<br />onMD5ResourceComplete&nbsp;Sleepy</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;skeleton<br />onMD5ResourceComplete&nbsp;Sleepy</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;animationSet<br />onMD5ResourceComplete&nbsp;Angry</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;geometry<br />onMD5ResourceComplete&nbsp;Angry</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;mesh<br />onMD5ResourceComplete&nbsp;Angry</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;skeleton<br />onMD5ResourceComplete&nbsp;Angry</span><span style="color: #007700">.</span><span style="color: #0000BB">md5mesh&nbsp;animationSet<br />[Fault]&nbsp;exception</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">information</span><span style="color: #007700">=</span><span style="color: #0000BB">Error</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">A&nbsp;Material&nbsp;instance&nbsp;cannot&nbsp;be&nbsp;shared&nbsp;across&nbsp;renderables&nbsp;with&nbsp;different&nbsp;animator&nbsp;libraries&nbsp;</span> </span> </code></div> <p>Thanks in advance.</p> 2017-05-02T08:18:08+00:00 AIR SDK 25 http://away3d.com/forum/viewthread/6213/ http://away3d.com/forum/viewthread/6213/#When:14:54:14Z <p>I currently have a successful implementation of the last Away3D source(4.x) using the Air SDK 23, but since the release of the Air SDK 24 and 25, I am unable to get Away3D to initialize at all. Does anyone have any suggestions?</p> <p>Note: I am using stage3DManager and stage3DProxy too.</p> 2017-04-13T14:54:14+00:00