Archive for September, 2008

3D in Flash 10

|

So Flash 10 is here yay, i know it was possible to develop astro content even before using nightly Flex builds but i didnt quite got to it. Anyway back to the topic i got my hands on the new Flash CS4 today and i was all curious about the 3D posibilites, and what i found out is both great and puzzling. Great because the 3D support is more that i was hoping for and puzzling because i am not quite sure how to implement some things in more direct way. Lets get to an example i coded in 5 minutes, its a typical carousel. Its a simple example of something that would be quite complicated to create an easy way, and here it is in few lines of code:

Example code: example source code

I am aware that there is a thing or two to optimize (loop creating the thumbs) but i just wanted to concentrate mainly on the new 3D.

The 3D is quite neat you can specify X,Y,Z translation as well as X,Y,Z rotation and scale. Yes thats nice but what about pivots, they are even more important now than they were in 2D so i got into experimenting. I found out that you cant set the pivot explicitly but its as before implicitly set to 0,0,0 and yes this means Z as well. As you can see in the example this way its easy to set 8 items with different X,Z offsets within an encapsulator and then simply rotating the encapsulator tadaaa yes its so simple. Great isnt it?

And whats puzzling you say? The problem is that even if we have Z translation its not affecting the depth sorting, so the items will sort by the index they were added to parent as usual. So we still need to calculate depth sorting explicitly. I tried to experiment with the new local3DToGlobal and globalToLocal3D methods but wasnt succesfull. If you have any luck share it ;)

PhysIT

|

I got back recently to one of my older research AS project that i did a while ago based on Box2D flash port Box2DAS3 lib 1.4 but since there is already version 2.1 of that library out i decided to discard it and create it from scratch using Flex. Its simple application with some potential, it automatically assigns physics attributes to any object you draw and binds it to the simulation world. Thats why the simple title, PhysIT!

The main problem in this application was to create the polygons from the drawn line, you cant simply store the mouse positions into an array and create polygon accordingly. Doing it this way may encounter 2 major problems.

First the array will be large and the polygon precision unnecessary complex. I resolved this using an algorithm that goes over all points and merge 2 adjancent points that are too close to each other. This algorithm is recursive since going over all again once is sometimes not enough ;)

Second and greater problem is that you can draw non-convex (concave) object which the physics engine simply cant process. I solved it first time by figuring out a fast triangulation algorithm (those that already made tristrips in OGL will know), but this time i decided on a different algorithm that simply takes non-convex object and breaks it into two or more convex objects as we know from geometry this is possible after all in worst scenario you can end up with triangles.

Ok, if you are interested in anything i mentioned just ask in forums, its way too complex to post algorithms here. Thank you.

Latest version: DEMO TEMPORARILY REMOVED

Forum Link: PhysIT forum topic

Be aware that you need to draw the objects CW becouse doing it CCW will result in possible bugs.

This is alpha version just for fun there may and will be errors ;)

Regular Downloader

|

So this is my first AIR project again one of those “is it possible”. I was trying to find a downloader for quite a time that would have an option to download and search for files on a webpage to a specified depth, this is quite common for downloaders but what i wanted more is the option to specify the search parameters for each depth level. For example you have a web that has a list of galleries and inside these galleries are images. So instead of using bruteforce downloader that would go over all links and download all images i wanted to specify that the downloader should look for only gallery links and then in the galleries only for certain images, tadaa. Unfortunately i wasnt able to find such a downloader (maybe console wget i am not sure). So i started to make one, in the past i would make it in C++ no question but now when we have AIR here i said to myself why not.

Here is a link to alpha version if you are interested: Regular Downloader binaries

Forum link: Regular Downloader forum topic

There is no help and the UI isn’t exactly intuitive to begin with so if you are curious just ask how to use it, but i think everyone will manage ;) Also if you have any questions about the implementation feel free to ask in the forum.

Enjoy ;)

FlashCORE IRC

|

This is an IRC project that i started simply because i wanted to try making an IRC client using Flex, one of those “is it possible?” projects ;)

I am planning to make an AIR version too, since the Adobe’s cross-domain policy is a real pain, making security implicitly is simply not a good idea and one of the Adobe’s wrong moves. Most of the admins that run IRC server and i talked to had no problem with my client connecting there but also had no time to set up some crazy socket policy daemons, so i ended up using socket proxies or other rather ugly solutions for quite a time. Finally i was able to find an IRC server where admin was a great guy and even set a shell account for me so i could put up my own perl scripts for setting the cross-domain straight. Why Adobe oh why… its pain, security should be defined explicitly not implicitly.

Latest version: CoreIRC page

Forum link: CoreIRC forum topic

Once i have a major version stable i will probably release source code as well, till then when you have a question about the implementation just ask ;)

We are back atlast.

|

Finally after almost a year the forum and blog is up again, unfortunately we lost our DBs becouse of somewhat strange policy of our previous provider, we lost the SVN too and that was the only major tragedy even thou we had all the latest versions and branches locally. But lets forget the past and look for the future. All our previous projects will be put up again on web and forum as well. If you participated in discussion feel free to do it again, if you had a question that wasn’t answered before just ask again, lets get rollin…

Once again sorry for the delay but we spent all the time developing ;)