Archive | Flex RSS feed for this section

Augmented Reality

23 Apr

A few weeks ago I was busy finding a graduate project. And during that time augmented reality looked very interesting. Most of you know what it means, for the others here a small explaining line from wikipedia: Augmented reality (AR) is a field of computer research which deals with the combination of real-world and computer-generated data (virtual reality), where computer graphics objects are blended into real footage in real time.

it's amazing

"it's amazing, it's the new Lego"

I’m not going deeper into this subject I only made this post to show some of the cool examples:

(more…)

Draw on 3D object

22 Apr

Here in Holland you have free news papers that you can read when you consume any kind of  public transportation.  In my childhood when I was bored I took a newspaper and draw all sorts of objects on  photo’s of famous people,  like: glasses, moustaches, beards and acme. I think this is also cool in flash

My original idea was to do it different than the newspaper and use 3D for it. Put a famous head as texture on a 3D model and draw on it. I’m not that far yet because it is hard to find an 3D model of a head. I now have an 3D plane with a texture on it. It is already possible to do the same things as in the newspaper and something more… You can save it to a server! So I encourage you to upload your creation to a server.

For now I have a photo from Berlusconi (Italian prime minister). Why? Because I love his quote on the recent earthquake victims that lost there home

“They have everything they need, they have medical care, hot food . . . Of course, their current lodgings are a bit temporary, but they should see it like a weekend of camping.”

berlusconi

Please upload those drawings and I will show them on my blog!!!!

start drawing

I hope I don’t get problems with the mafia

Known problems: Slow and you see some grey dots if you move the mouse (don’t know the solution)

Why has AIR file.browseForSave no FileFilter option

3 Jun

I try to create my own extension with a saved AIR file. The point in doing this is that the user knows what files are created by what program and a file without an extension is just plain ugly.

When you save a file in other programs you can choose to overwrite a file (that is created before or has a known extension) or create a new file. I tried to find a way in AIR to do this same thing. I found one article on an Adobe blog that uses a FileFilter in combination with a file.browseForSave but he is using it in a way that it has no effect and is pretty useless. He is creating a FileFilter but he is never using it:

save:function(){
var fileFilter = new air.FileFilter("To Do Lists", "*.todo");
ToDo.currentDirectory.addEventListener(air.Event.SELECT, ToDo.fileSaved.bind(ToDo) );
ToDo.currentDirectory.browseForSave("Save To-do List");
}

I hear you think “who cares about the FileFilter” because it sounds like a minor problem and maybe it is. But for me it seems easy to build because browse(), browseForOpen() and browseForOpenMultiple() are using it.

I wonder if there is a way to work around this problem. It is maybe a little detail but it are the little details that make things great.

How to find an address with Google maps Flash API

19 May

After the Flash Google maps API release I spend some time to see what is possible. I started with the documentation from Google. In there documentation they are using the latitude and longitude coordinates to set the center of your map. This is not really a human readable way to do it and personally I never used the latitude and longitude coordinates to find a city or street in Google Maps. That is why I started searching for a way to center the map with an address.

Google Maps Application

I build a small application with source-code available in Flex that is using this technique. In the left upper corner you can search your own address. I use ClientGeocoder to search for the address but the problem i’m running in to is that you can’t run it local because he returns this error.

Warning: Domain maps.googleapis.com does not explicitly specify a
meta-policy, but Content-Type of policy file
http://maps.googleapis.com/mapsapi/crossdomain.xml is
'text/x-cross-domain-policy'.  Applying meta-policy 'by-content-type'.

You can’t use ClientGeocoder crossdomain. You should call it from a domain that has a registered Google Maps API key in my case “http://blog.arnomanders.nl”.

Air file.nativePath Vs. file.url

8 May

Is it me or is file.url a lot easier to use than file.nativePath in Adobe AIR. Maybe I’m missing something because every tutorial or code snippet I can find uses file.nativePath.

I’m busy building an AIR application that can be used on Windows and Mac OS. I have to take care of the file structure of both systems. After I test my application on a Mac I couldn’t load anything from it. The reason of this problem is that Mac needs “file://” in front of the file URL to load the file correct.

When I had this problem I searched the internet for a solution. I found very complex solutions at EverythingFlex and Snipplr. But then I start to examine the File object and found just the right file url (on the Mac it adds “file://” in front of the url) just accessible with File.url. Then I tested it on Windows and it worked perfect.

I see no reason why I shouldn’t use this simple version of all the long code solutions that are available on the web. But like I said maybe I’m missing something?

Direction of the TileList behaves strange

18 Apr

I stumbled into an incorrect working function of the TileList in Flex. It looks like they swopped a few variables around.

If you set the direction of the TileList to horizontal it looks like Flex doesn’t care about the option and just scolls vertical. After that I checked an Adobe quickstart guide to know sure that I wasn’t doing anything wrong. But I couldn’t find anything that I missed.

Because I hate it if things don’t work I try everything to get it working. So I tried to set the direction to vertical just to see if something was happening and now the TileList scolled horizontal… very strange.

here is a example with source code (right click)

TileList problem example

Maybe I’m doing something wrong? Do other people have the same problem?

More playing with 3D and 3D physics engine

15 Apr

I extended the Flex 3D example of my previous post some more. Now you can drag (left mousebutton) the objects and bounce them into each other.

away3d tile dragging

I think the smart visiters will see that it look a little like TileUI from Doug McCune or TileUI copy of Bill White. I tried to make something like that but I used Away3D and the WOW physics engine.

(more…)

Playing around with 3D and WOW

3 Apr

Watch the Away3D and WOW demo. Sometimes they stand like a tower and sometimes it almost look like they explode. Click on the onderground to reset the cubes to a random position

away3d with wow

(more…)

Get full file path in AIR

1 Apr

Normally if you want a file path in Flex to upload a file you use FileReference() with a browse(). Last week I tried the same technique to get a file dragged from the desktop to my AIR application. After fixing a strange problem the code worked but the next problem appeared to me. With FileReference I only get the file name and I want the full path so save this to a SQLite database.

I searched quite some time to find the solution for this problem so I hope I save someone else his time with this explanation. In an AIR application you have an extra class called File. If you use this you get the full file path. Here is a little example code:

?View Code ACTIONSCRIPT
import mx.events.FileEvent;
private var openFile:File = new File()
 
private function openBrowseWindow():void{
	openFile.addEventListener(Event.SELECT, onOpenFileComplete);
	openFile.browse();
}
 
private function onOpenFileComplete(event:Event):void{
	trace("event: "+event.target.nativePath);
}

Preformance tips Away3D

31 Mar

While I was building my ImageViewer3D I noticed a few things that can make everything just a little bit faster. And for the challenge and for fun I made a sort of testing application. I build it with Flex and Away3D

You can change the a few things such as the amount of 3d objects, type of filter, zoom of the camera and you can see how much this effects the framerate. After every change I reset the average FPS (frames per second) to give the best indication what the effect of the new options will have on the average FPS.
Probably this test is not really reflecting how much faces Away3D can render. A lot of things I do can be done more efficient. The source is enabled

preformance tester

preformance test

Some other preformance tips

I couldn’t build everything in because of the lack of time and also this project would be to big to be fun. Some other things that you can do to get the preformance up.

  • No precision on materials
  • No smoothing for materials or turn the smoothing on when it is needed
  • Niels Bruin told me this one: Set the application framerate to 60
  • Make sure that now 3D objects are in each other
  • This trick is from Maikel Sibbal: Only render if there is really something changed
  • 3D Objects close to the camera slows down the fps
Page 2 of 41234