Away3D Forum http://away3d.com/forum/ Away3D Forum en Copyright 2013 2013-05-18T15:29:04+00:00 Normal map software http://away3d.com/forum/viewthread/4494/ http://away3d.com/forum/viewthread/4494/#When:05:16:29Z <p>Hello!</p> <p>I would like to know what software everyone is using to create normal maps. I assume that people are not painting them manually in Photoshop!</p> <p>TIA</p> 2013-05-17T05:16:29+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 AwayBuilder as a level editor ? http://away3d.com/forum/viewthread/4497/ http://away3d.com/forum/viewthread/4497/#When:15:25:34Z <p>Hi !</p> <p><br /> First of all, congrats on making up this tool! Away3D’s ecosystem is getting richer month after month. <img src="/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /></p> <p><br /> I have a little question. Can this tool be used as a level editor ? Maybe not now, but in a future version ?</p> <p>It is rather tough to find 3D level editors. Often times you have to build your own, which takes time and so is costly. Publicly available ones are usually tied to one engine (i.e. not Away3D :p) and are not flexible, because they work for specific types of games only, instead of just using the core rendering engine to layout assets, terrain, sounds and enable custom game-dependent properties on the side.</p> <p>Plus, they’re not open source, so can’t be tweaked to add custom features to take advantage of specific game functionalities.</p> <p><br /> AwayBuilder sounds like an awesome opportunity to make the ultimate 3D level editor. No ?</p> <p>You guys describe it as “a designer interface for accessing the visual stack in Away3D”, which sounds <i>almost</i> like a level editor, so it left me wondering. Though to be one, it would need to support terrain generation and editing among other things, but maybe that’s on the todo…<br /> If not, is there any other such tool planned ?</p> <p><br /> PS: Terrain generation based on <a href="http://develop.scee.net/files/presentations/cedec2008/PhyreEngine_CEDEC2008Speech_e.pdf">Phyre Engine’s technique</a> would be awesome in AwayBuilder. Every single point listed in the “Goals” section is exactly what I’m looking for! <img src="/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /></p> 2013-05-17T15:25:34+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 please help me… http://away3d.com/forum/viewthread/4466/ http://away3d.com/forum/viewthread/4466/#When:16:18:16Z <p>i hope you can help me.<br /> i want to create a 3d view of a building in flash same this<br /> <a href="http://dotnetboy.zgig.ir/p1.jpg">http://dotnetboy.zgig.ir/p1.jpg</a><br /> of course i want to be dynamic.for example user can zoom and rotate camera view.<br /> can i do it with flash 3d libraries?<br /> if yes which is the best?<br /> if no what is your idea?</p> <p>of course i should to say that i using pv3d now but have a problem with it:<br /> i want to draw a room view but output is:<br /> <a href="http://dotnetboy.zgig.ir/out.jpg">http://dotnetboy.zgig.ir/out.jpg</a><br /> why?<br /> this is my code:</p> <div class="codeblock"><code><span style="color: #000000"> <span style="color: #0000BB">package&nbsp;&nbsp;{<br />&nbsp;<br />&nbsp;import&nbsp;flash</span><span style="color: #007700">.</span><span style="color: #0000BB">display</span><span style="color: #007700">.</span><span style="color: #0000BB">MovieClip</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">scenes</span><span style="color: #007700">.</span><span style="color: #0000BB">Scene3D</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">objects</span><span style="color: #007700">.</span><span style="color: #0000BB">primitives</span><span style="color: #007700">.</span><span style="color: #0000BB">Cube</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">materials</span><span style="color: #007700">.</span><span style="color: #0000BB">ColorMaterial</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">materials</span><span style="color: #007700">.</span><span style="color: #0000BB">utils</span><span style="color: #007700">.</span><span style="color: #0000BB">MaterialsList</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">cameras</span><span style="color: #007700">.</span><span style="color: #0000BB">Camera3D</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">view</span><span style="color: #007700">.</span><span style="color: #0000BB">Viewport3D</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">render</span><span style="color: #007700">.</span><span style="color: #0000BB">BasicRenderEngine</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;org</span><span style="color: #007700">.</span><span style="color: #0000BB">papervision3d</span><span style="color: #007700">.</span><span style="color: #0000BB">materials</span><span style="color: #007700">.</span><span style="color: #0000BB">MovieMaterial</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;flash</span><span style="color: #007700">.</span><span style="color: #0000BB">events</span><span style="color: #007700">.</span><span style="color: #0000BB">Event</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;flash</span><span style="color: #007700">.</span><span style="color: #0000BB">filters</span><span style="color: #007700">.</span><span style="color: #0000BB">BlurFilter</span><span style="color: #007700">;<br />&nbsp;</span><span style="color: #0000BB">import&nbsp;flash</span><span style="color: #007700">.</span><span style="color: #0000BB">display</span><span style="color: #007700">.</span><span style="color: #0000BB">Stage</span><span style="color: #007700">;<br />&nbsp;<br />&nbsp;<br />&nbsp;public&nbsp;class&nbsp;</span><span style="color: #0000BB">Main&nbsp;</span><span style="color: #007700">extends&nbsp;</span><span style="color: #0000BB">MovieClip&nbsp;{<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #007700">public&nbsp;var&nbsp;</span><span style="color: #0000BB">view</span><span style="color: #007700">:</span><span style="color: #0000BB">Viewport3D</span><span style="color: #007700">;<br />&nbsp;&nbsp;public&nbsp;var&nbsp;</span><span style="color: #0000BB">renderer</span><span style="color: #007700">:</span><span style="color: #0000BB">BasicRenderEngine</span><span style="color: #007700">;<br />&nbsp;&nbsp;public&nbsp;var&nbsp;</span><span style="color: #0000BB">scene</span><span style="color: #007700">:</span><span style="color: #0000BB">Scene3D</span><span style="color: #007700">;<br />&nbsp;&nbsp;public&nbsp;var&nbsp;</span><span style="color: #0000BB">cube</span><span style="color: #007700">:</span><span style="color: #0000BB">Cube</span><span style="color: #007700">;<br />&nbsp;&nbsp;public&nbsp;var&nbsp;</span><span style="color: #0000BB">cam</span><span style="color: #007700">:</span><span style="color: #0000BB">Camera3D</span><span style="color: #007700">;<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;public&nbsp;function&nbsp;</span><span style="color: #0000BB">Main</span><span style="color: #007700">()&nbsp;</span><span style="color: #0000BB">{<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">grayMaterial&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">ColorMaterial</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">ColorMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">0x33cc99</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">:</span><span style="color: #0000BB">MaterialsList</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">MaterialsList</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">grayMaterial</span><span style="color: #007700">,</span><span style="color: #DD0000">"front"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">grayMaterial</span><span style="color: #007700">,</span><span style="color: #DD0000">'back'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">grayMaterial</span><span style="color: #007700">,</span><span style="color: #DD0000">'left'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">grayMaterial</span><span style="color: #007700">,</span><span style="color: #DD0000">'right'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">grayMaterial</span><span style="color: #007700">,</span><span style="color: #DD0000">'top'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">grayMaterial</span><span style="color: #007700">,</span><span style="color: #DD0000">'bottom'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">Material2&nbsp;</span><span style="color: #007700">:&nbsp;</span><span style="color: #0000BB">ColorMaterial</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">ColorMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">0x99cc33</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">:</span><span style="color: #0000BB">MaterialsList</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">MaterialsList</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Material2</span><span style="color: #007700">,</span><span style="color: #DD0000">"front"</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Material2</span><span style="color: #007700">,</span><span style="color: #DD0000">'back'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Material2</span><span style="color: #007700">,</span><span style="color: #DD0000">'left'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Material2</span><span style="color: #007700">,</span><span style="color: #DD0000">'right'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Material2</span><span style="color: #007700">,</span><span style="color: #DD0000">'top'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">.</span><span style="color: #0000BB">addMaterial</span><span style="color: #007700">(</span><span style="color: #0000BB">Material2</span><span style="color: #007700">,</span><span style="color: #DD0000">'bottom'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//movie&nbsp;material<br />&nbsp;&nbsp;&nbsp;//var&nbsp;logoMaterial:MovieMaterial&nbsp;=&nbsp;new&nbsp;MovieMaterial(&nbsp;new&nbsp;myMovie()&nbsp;);<br />//&nbsp;&nbsp;&nbsp;//replace&nbsp;"ActiveTutsLogo"&nbsp;above&nbsp;with&nbsp;the&nbsp;Class&nbsp;name&nbsp;of&nbsp;your&nbsp;movie&nbsp;clip<br />//&nbsp;&nbsp;&nbsp;var&nbsp;materialsList:MaterialsList&nbsp;=&nbsp;new&nbsp;MaterialsList();<br />//&nbsp;&nbsp;&nbsp;materialsList.addMaterial(&nbsp;logoMaterial,&nbsp;"front"&nbsp;);<br />//&nbsp;&nbsp;&nbsp;materialsList.addMaterial(&nbsp;logoMaterial,&nbsp;"back"&nbsp;);<br />//&nbsp;&nbsp;&nbsp;materialsList.addMaterial(&nbsp;logoMaterial,&nbsp;"left"&nbsp;);<br />//&nbsp;&nbsp;&nbsp;materialsList.addMaterial(&nbsp;logoMaterial,&nbsp;"right"&nbsp;);<br />//&nbsp;&nbsp;&nbsp;materialsList.addMaterial(&nbsp;logoMaterial,&nbsp;"top"&nbsp;);<br />//&nbsp;&nbsp;&nbsp;materialsList.addMaterial(&nbsp;logoMaterial,&nbsp;"bottom"&nbsp;);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">scene&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Scene3D</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//new&nbsp;drawing<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">backCube</span><span style="color: #007700">:</span><span style="color: #0000BB">Cube</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Cube</span><span style="color: #007700">(</span><span style="color: #0000BB">materialList</span><span style="color: #007700">,</span><span style="color: #0000BB">800</span><span style="color: #007700">,</span><span style="color: #0000BB">25</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">backCube</span><span style="color: #007700">.</span><span style="color: #0000BB">x</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">backCube</span><span style="color: #007700">.</span><span style="color: #0000BB">y</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">bottomCube&nbsp;</span><span style="color: #007700">:</span><span style="color: #0000BB">Cube</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Cube</span><span style="color: #007700">(</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">,</span><span style="color: #0000BB">800</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">,</span><span style="color: #0000BB">25</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">bottomCube</span><span style="color: #007700">.</span><span style="color: #0000BB">y</span><span style="color: #007700">=-</span><span style="color: #0000BB">250</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//bottomCube.rotationX=80;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">var&nbsp;</span><span style="color: #0000BB">topCube&nbsp;</span><span style="color: #007700">:</span><span style="color: #0000BB">Cube</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Cube</span><span style="color: #007700">(</span><span style="color: #0000BB">materialList2</span><span style="color: #007700">,</span><span style="color: #0000BB">800</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">,</span><span style="color: #0000BB">25</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">topCube</span><span style="color: #007700">.</span><span style="color: #0000BB">y</span><span style="color: #007700">=</span><span style="color: #0000BB">250</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">rightCube&nbsp;</span><span style="color: #007700">:</span><span style="color: #0000BB">Cube</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Cube</span><span style="color: #007700">(</span><span style="color: #0000BB">materialList</span><span style="color: #007700">,</span><span style="color: #0000BB">25</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//topCube.rotationX=100;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">rightCube</span><span style="color: #007700">.</span><span style="color: #0000BB">x</span><span style="color: #007700">=</span><span style="color: #0000BB">400</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;var&nbsp;</span><span style="color: #0000BB">leftCube</span><span style="color: #007700">:</span><span style="color: #0000BB">Cube</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Cube</span><span style="color: #007700">(</span><span style="color: #0000BB">materialList</span><span style="color: #007700">,</span><span style="color: #0000BB">25</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">,</span><span style="color: #0000BB">500</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//leftCube.rotationX=0;<br />//&nbsp;&nbsp;&nbsp;leftCube.rotationY=0;<br />//&nbsp;&nbsp;&nbsp;leftCube.rotationZ=0;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">leftCube</span><span style="color: #007700">.</span><span style="color: #0000BB">x</span><span style="color: #007700">=-</span><span style="color: #0000BB">400</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//leftCube.y=250;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;//var&nbsp;backCube:Cube=new&nbsp;Cube(materialList,750,50,250);<br />//&nbsp;&nbsp;&nbsp;backCube.z=180;<br />//&nbsp;&nbsp;&nbsp;backCube.y=200;<br />//&nbsp;&nbsp;&nbsp;<br />//&nbsp;&nbsp;&nbsp;var&nbsp;bottomCube&nbsp;:Cube=new&nbsp;Cube(materialList,800,25,500,10,10,10);<br />//&nbsp;&nbsp;&nbsp;bottomCube.rotationX=80;<br />//&nbsp;&nbsp;&nbsp;<br />//&nbsp;&nbsp;&nbsp;var&nbsp;topCube&nbsp;:Cube=new&nbsp;Cube(materialList,800,25,500,10,10,10);<br />//&nbsp;&nbsp;&nbsp;topCube.rotationX=100;<br />//&nbsp;&nbsp;&nbsp;topCube.y=400;<br />//&nbsp;&nbsp;&nbsp;<br />//&nbsp;&nbsp;&nbsp;<br />//&nbsp;&nbsp;&nbsp;var&nbsp;leftCube:Cube=new&nbsp;Cube(materialList,500,25,400);<br />//&nbsp;&nbsp;&nbsp;leftCube.rotationX=0;<br />//&nbsp;&nbsp;&nbsp;leftCube.rotationY=0;<br />//&nbsp;&nbsp;&nbsp;leftCube.rotationZ=0;<br />//&nbsp;&nbsp;&nbsp;leftCube.x=-400;<br />//&nbsp;&nbsp;&nbsp;leftCube.y=250;<br />&nbsp;&nbsp;&nbsp;//cube=new&nbsp;Cube(materialList);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;//cube.rotationX=-10;<br />//&nbsp;&nbsp;&nbsp;cube.rotationY=40;<br />&nbsp;&nbsp;&nbsp;//cube.rotationZ=10;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">cam</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Camera3D</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//cam.x=0;<br />//&nbsp;&nbsp;&nbsp;cam.y=225;<br />//&nbsp;&nbsp;&nbsp;cam.z=-800;<br />&nbsp;&nbsp;&nbsp;//cam.focus=10;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</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">backCube</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</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">rightCube</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</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">leftCube</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</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">bottomCube</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;</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">topCube</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//add&nbsp;more&nbsp;cubes<br />&nbsp;&nbsp;&nbsp;//for(var&nbsp;i:int=0;i&lt;3;i++)<br />//&nbsp;&nbsp;&nbsp;{<br />//&nbsp;&nbsp;&nbsp;&nbsp;cube&nbsp;=&nbsp;new&nbsp;Cube(materialList);<br />//&nbsp;&nbsp;&nbsp;&nbsp;cube.x&nbsp;=i*350;<br />//&nbsp;&nbsp;&nbsp;&nbsp;cube.scale=0.40;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;cube.rotati&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;cube.rotati<br />//&nbsp;&nbsp;&nbsp;&nbsp;scene.addChild(cube);<br />//&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">view</span><span style="color: #007700">=new&nbsp;</span><span style="color: #0000BB">Viewport3D</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">autoScaleToStage</span><span style="color: #007700">=</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&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">renderer&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">BasicRenderEngine</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">renderer</span><span style="color: #007700">.</span><span style="color: #0000BB">renderScene</span><span style="color: #007700">(</span><span style="color: #0000BB">scene</span><span style="color: #007700">,</span><span style="color: #0000BB">cam</span><span style="color: #007700">,</span><span style="color: #0000BB">view</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//var&nbsp;fil:BlurFilter=new&nbsp;BlurFilter();<br />//&nbsp;&nbsp;&nbsp;cube.filters=[fil];<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&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">,</span><span style="color: #0000BB">on_ef</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;</span><span style="color: #007700">private&nbsp;function&nbsp;</span><span style="color: #0000BB">on_ef</span><span style="color: #007700">(</span><span style="color: #0000BB">evt</span><span style="color: #007700">:</span><span style="color: #0000BB">Event</span><span style="color: #007700">):</span><span style="color: #0000BB">void<br />&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//cube.rotati&nbsp;+5;&nbsp;&nbsp;&nbsp;&nbsp;//cube.rotati&nbsp;+5;&nbsp;&nbsp;&nbsp;&nbsp;//cube.rotati&nbsp;+5;<br />//&nbsp;&nbsp;&nbsp;renderer.renderScene(scene,cam,view);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">}<br />&nbsp;}<br />&nbsp;<br />}&nbsp;</span> </span> </code></div> <p><br /> thanks….</p> 2013-05-08T16:18:16+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