{"id":130,"date":"2007-10-11T09:33:02","date_gmt":"2007-10-11T16:33:02","guid":{"rendered":"http:\/\/labs.zeh.com.br\/blog\/?p=130"},"modified":"2007-10-11T09:41:29","modified_gmt":"2007-10-11T16:41:29","slug":"tweening-in-five3d","status":"publish","type":"post","link":"https:\/\/labs.zeh.com.br\/blog\/?p=130","title":{"rendered":"Tweening in FIVe3D"},"content":{"rendered":"<p>You may not have heard of it, but <a href=\"http:\/\/five3d.mathieu-badimon.com\/\">FIVe3D<\/a> is <a href=\"http:\/\/www.mathieu-badimon.com\/\">Mathieu Badimon<\/a>&#8216;s collection of ActionScript 2 classes to create 3d geometry in Flash movies. You can see FIVe3D at work at Mathieu&#8217;s award-winning <a href=\"http:\/\/lab.mathieu-badimon.com\/\">LAB website<\/a>.<\/p>\n<p><p>The big difference when compared to existing packages such as <a href=\"http:\/\/code.google.com\/p\/papervision3d\/\">Papervision3D<\/a> &#8211; which is also manages to be its biggest advantage and bigger disadvantage &#8211; is that FIVe3D is based on vector drawings; meaning all geometry is produced by the drawing API (well, technically, Papervision3D also uses the drawing API, but in its case, it&#8217;s more focused on a surface drawn with bitmap fills).<\/p>\n<p>That is an advantage because since all points and edges used are known, the surface projection and distortion can be as accurate as mathematically possible; drawing things like text using this extension can produce a much better result than having it on a plane and having it mapped using triangles. That is also a disadvantage because you can&#8217;t have texture fills, and you need to describe all of your drawing data mathematically (including all text).<\/p>\n<p>Still, the result is pretty good and that&#8217;s why this is a great collection of classes to have available. Depending on the result wanted, it makes total sense to pick FIVe3D over any other 3d rendering extension.<\/p>\n<p>While written in Actionscript 2, FIVe3D uses a structure and syntax that is very similar to Actionscript 3. I recently started using FIVe3D on a website I&#8217;m developing, and I first gave it a whirl to see how easy it was to tween properties of instances created with it. Below is an early result of that experimenting; click the object to rotate it to random directions. It&#8217;s one of the original FIVe3D examples, but with just a few lines added to make the transition go smoothly from one random rotation to the other.<\/p>\n<p><!--more--><script type=\"text\/javascript\" src=\"\/blog\/f\/swfobject.js\"><\/script><\/p>\n<div id=\"flashcontent_hiworld_five3d\">{}<\/div>\n<p><script type=\"text\/javascript\">\n\tvar fo = new SWFObject(\"\/blog\/f\/hiworld_five3d.swf\", \"index\", \"500\", \"400\", \"8\", \"#ffffff\", true);\n\tfo.setAttribute('xiRedirectUrl', 'https:\/\/labs.zeh.com.br\/blog');\n\tfo.addParam(\"allowFullScreen\", \"true\");\n\tfo.write(\"flashcontent_hiworld_five3d\");\n<\/script><\/p>\n<p>Download the source <a href=\"http:\/\/tweener.googlecode.com\/svn\/trunk\/examples\/hiworld_five3d_as2_flash8.zip\">here<\/a> (Flash 8, Actionscript 2).<\/p>\n<p>Again, this is an original FIVe3D example, so I won&#8217;t claim ownership over it or anything. This is all the code I&#8217;ve actually added to it:<\/p>\n<p><pre>import caurina.transitions.Tweener;\r\n...\r\nTweener.addTween(this, {\r\n\t_rotationx:Math.random()*100-50, \r\n\t_rotationy:Math.random()*100-50,\r\n\t_rotationz:Math.random()*100-50,\r\n\ttime:0.6,\r\n\ttransition:\"easeInOutBack\"\r\n});\r\n<\/pre>\n<p>Because FIVe3D exposes aspects of its instances as numeric properties, animating via actionscript on it is pretty much a no-brainer: just tween the values.<\/p>\n<p>If anyone is interested, I&#8217;d definitely recommend anyone <a href=\"http:\/\/five3d.mathieu-badimon.com\/\">giving FIVe3D a test<\/a>. It doesn&#8217;t replace more robust packages such as Papervision3D, but the reverse is also true.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may not have heard of it, but FIVe3D is Mathieu Badimon&#8216;s collection of ActionScript 2 classes to create 3d geometry in Flash movies. You can see FIVe3D at work at Mathieu&#8217;s award-winning LAB website. The big difference when compared to existing packages such as Papervision3D &#8211; which is also manages to be its biggest [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=\/wp\/v2\/posts\/130"}],"collection":[{"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=130"}],"version-history":[{"count":0,"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=\/wp\/v2\/posts\/130\/revisions"}],"wp:attachment":[{"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=130"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=130"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labs.zeh.com.br\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=130"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}