Latest Entries

Experiment #2 – Open Frameworks

I’m late as usual but after months of looking over other people works and the current Kinect frenzy, I’ve finally tried Open Frameworks and it wasn’t as painful as I thought it would be, in fact it was quite fun and the performance it’s blazing fast.

Expect another influx of experiments from it soon.

Experiment #1 – Objective C

Prefab with Away3D

Prefab is the most ingenious flash tool I’ve ever encountered yet; it makes 3D game in flash a snap.

But if you just starting to probe into this tool, there are several quirks that you must notice and it mostly involves the modeling and BSP generating process, so here it goes;

How to model

  • First note the model has to be simple, so if you were planning to have any nooks or crannies on model ensure that the proximity between any triangles are as far apart as possible.

Prefab Simple

  • Every vertex has to be united with one another and ensure that there are no vertices holes.
  • If you have a large environment try to make the shapes as one enormous chunk, a modular shapes can make the calculation process much heavier and sometimes can lead into an application crash.
  • If the model has multiple rooms then ensure the walls are part of the model.

Prefab Bad
Prefab Good
How to generates the BSP

  • Depending on what application you are using to build the model, its best to just export it as Collada 1.4 although Prefab does supports other format but the occasion happens haphazardly.
  • Once you have the Collada file when you import it, the model sometimes will look out of scale, simply rescale it by modifying Scene Obj Scale and ensure that camera guideline fits snugly inside the model just like you expected to be, even if you have to augment the scale to 100 times its original scale.

Prefab Good
Follow these steps and I guarantee you like yourself more at the end of the day and the last thing that you have to notice is that when the texture is generated, it will creates a mysteriously huge PNG file (hopefully that will be gone in the next version), you can alter that just by re-exporting the texture from Photoshop.

And I think that just about it, even though this breakthrough is awe-inspiring but you still can’t rely it to make a full blown FPS game just yet. So enjoy the demo below, use your arrow keys and mouse to navigate.

Idiosyncrancies and Propaganda

I’ve came across my prehistoric blog (yes I had blogged before since 2003) and found my old post is still relevant up to this moment and everywhere I went people seems to be blissfully ignorant about the concept.

And so it goes…

A few weeks ago I’ve had a brainstorming session with some of my friends who worked in Advertising Company, his company had this client who was trying to promote their detergent product and their demographical audience was the Indonesian middle class family.

This advertising company was trying to concoct the ideal message to convey the aforementioned product to the targeted consumers and they came up with a story, which sounded something like this;

It was Monday morning and people were busy preparing the day and amongst this hustle and bustle there was a group of children running merrily to school.

When the morning ceremony came, children and teachers were rushing neatly towards the field, the flag was raised and everybody saluted as the clean flag (thanks to the detergent) flutters proudly in the sky, there was a great sense of patriotic everywhere and then a closing caption emerged-We are proud with Indonesian product and we are the XXX Detergent!

Upon hearing this explanation I was gobsmacked, it was very beautiful yet something was missing… something that was very obvious.

The most important aspect which we have to recognize is that aesthetic perceptions are differ between regions/countries/cultures and this concept was definitely not Indonesian (even though the modern urban young generation appreciated and adopted western culture more vigorously) but in this case the target consumer of this product had been the Indonesian middle class population and most of these people who were categorized within this group received only moderate education level and have less influence of western culture –except of course facebook- the concept was too complicated to be comprehend by the majority of this group and most likely will be completely ignored by them.

Conveying effective message needs a relevant context, which the listeners can instantly relate to. This is I think is the basic principle of delivering a good message, advertiser tend to ignore what the customer actually needs and what their background are.

Although in some cases if you have a very powerful product behind the message, preemptive communication can cultivates more yields, think about iPad to the technophiles or Justin Timberlake to the naïve adolescent female teenagers, it will fuel them even more. But these ultimate products emerges very rarely, ergo the basic premise still stands, give the customers something they can relate to and in order to achieve this, first understand their needs/traits/psychological patterns/cultural background/educational background/economic capacity/social status/social environment/preferences/physiology/gender/spiritual believe… well the list goes on.

Establishment of the concept enables for further adaptations, which can be cultivated to various platforms, as long as the basic principle is used.

This is always the problem with artist/designer/creative workforce in Indonesia, we were and are still the by-product of the western culture and contaminated at such level, we most of the time, forget our own identities and ignore this basic principle and even reject it completely.

iPhone OS 4

snow whiteThere is always something exciting about Apple, whenever they launch their product everybody just mesmerized by it, gasped and awed in unison to its shines, it reminds me of Willy Wonka when he unveils his Chocolate factory.

iPhone OS4 had just been released today and has introduced some new features such as:

  • Wallpaper on the home screen : Yes! Now we can change our wallpaper.
  • Multitasking/background tasks : Of course with some limitations.
  • Unified e-mail inbox : Browse different accounts in one inbox (that is what I’ve understood anyway).
  • iBooks! : Move over kindle and other product alike.
  • App folders: for all of you that is obsessive compulsive.
  • Open e-mail attachments in other apps.
  • Game Center.
  • Mobile advertising (iAds).

But out of these features, iAds seems to be the most prominent as Steve hinted.

The average user spends over 30 minutes every day using apps on their phone. If we said we wanted to put an ad up every 3 minutes, that’s 10 ads per device per day. That would be 1b ad opportunities per day.

I can almost see the dollar sign lit up in his eyes when he uttered that sentence, its no secret digital Ads worth of billions of dollars and Apple wants to take a massive bite of it.

iAds
Steve again had contended that Ads today is attractive (he was showing a flash banner as the bad example when mentioned this and I could have sworn he was smirking in triumph) but lacks the emotional value, although I will guarantee the iAds will be another of “Shoot [something] to win [something]“.

iPhone iAds 1
Steve said that there’s nothing like it, but didn’t I just developed something similar for flash banner a couple of weeks ago?

iPhone iAds 2
That’s so emotional, I had tears of joy in my eyes.

iPhone iAds 3
In conclusion despite of another unprepared PR charade and the implicit statement of “we don’t care about you, just shut up and buy the damn product”, but the matter of fact is Apple had successfully delivered one of the greatest invention of the century, and its glory had captivated the materialistic world ever since and until the charm still lingers, we -the gullible customer of the modern world- will still perceive that what glitters is always Apple.

PS: Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited. which means goodbye Flash CS5 and thanks for the effort (but at least my time learning objective-c didn’t go to waste :) )

Pixels

Perfection!

Created by Patrick Jean from One More Production.

Simple Text to Speech method for Flash

UPDATE: October 1st, 2012
I noticed that the code doesn’t work anymore, since they’ve added a crossdomain reference and modified the API a bit, but a simple proxy should do the trick, check this blog for solution.

I’ve just discovered an ultra-simple way of converting text to speech utilizing an undocumented Google API code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import flash.media.Sound;
import flash.net.URLRequest;

var _path:String = 'http://translate.google.com/translate_tts?q=';
var _sound:Sound = new Sound();

// all it takes is just to pass the words to the path                      
_sound.load(new URLRequest(_path+ 'hello world'));
_sound.addEventListener(Event.COMPLETE, soundLoaded);

function soundLoaded(e:Event):void
{
    _sound.play();
       
    _sound.removeEventListener(Event.COMPLETE, soundLoaded);
    _sound = null;
}

It’s limited, yet the practical uses of it are endless.

Here’s a little demo.

AS3 to Cocoa : Part 1

I’ve been learning awful lot of Cocoa lately, and to be honest at first I thought the syntax would be somewhat similar to what AS3 is, but apparently I’ve found a massive gap separating between the two.

There are a lot of tutorials and forums out there that can guide you into the right direction and some of them are written by flash aficionados and one of the good one is what the revered Keith Peters has written in his blog, but again as an autodidact programmer reading those tutorials was difficult, what is pointers? why is NSObject? but eventually with much persistence and an occasional mental breakdown, I’ve finally had a grasp on the language.

If you want to follow this tutorial, first ensure you’ve downloaded all of the necessities and also I’m assuming have a decent understanding on AS3 and you’ve had a bit of a tinker with the Xcode otherwise click here.

What we are about to do is obviously nothing complex, just something to familiarize ourselves with the Objective-C concept.

First open your Xcode and select New Project which will open the New Project panel.

New Project Panel - AS3 to Cocoa Touch part 1
On the New Project Panel under Mac OS X tab select Command Line Utility and select the Foundation Tool.

Author Environment - AS3 to Cocoa Touch part 1
If everything went well you should now be at the author environment just as illustrated above and open the message file if you haven’t done so, which is denoted by the .m extension.

Objective-C is all about Object Oriented Programming (OOP) and its quite strict as oppose to AS3, creating a class has to be preceded by defining the method(s) and variable(s) on the interface first.

So let’s create a simple interface for MyPet class.

1
2
3
4
5
6
7
8
9
@interface MyPet : NSObject  {
    NSString *petName;
}

- (void) makeSound;
- (void) setName:(NSString*) n;
- (NSString *) getName;

@end

If this is the first time you’ve seen Objective-C it may appeared alien at the moment, but let see the AS3 equivalent of MyPet class interface.

1
2
3
4
5
6
7
8
9
10
11
package com.farm {

    public interface MyPet {

        function makeSound():void;
        function setName(n:String):void;
        function getName():String;

    }

}

As we can see there are some slight differences, a few elements to note are the NSObject, which is in a nutshell is a base interface, the definition of petName as the class variable and the absent of a package.

Now let’s proceed with the implementation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@implementation MyPet

- (void) makeSound
{
    NSLog(@"Tweets");
}

- (void) setName:(NSString *) n;
{
    petName = n;
}

- (NSString *) getName
{
    return petName;
}

@end

and the AS3 equivalent.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.animal
{
    import com.farm.*;

    public class Bird implements MyPet
    {

        private var _petName:String;

        public function makeSound():void
        {
            trace("Tweets");
        }

        public function setName(n:String):void
        {
            _petName = n;
        }

        public function getName():String
        {
            return _petName;
        }  
    }
}

I think up to this point everything would made sense now and of course Objective-C has a few execution directives we have to follow, such as the @implementation and @end.

Finally the instantiation.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    MyPet *bird = [MyPet new];

    [bird setName:@"Polly"];
    [bird makeSound];

    NSString *birdName = [bird getName];
    NSLog(@"%@",birdName);

    [bird release];

    [pool drain];
    return 0;
}

In here you must be wondering what the main method is doing there. Think about the initial execution inside a document class in AS3, every Objective-C will be initiated with a main method which the compiler will call, passing a few parameters along the way to check the code.

Other elements are the @”Polly” which is just the way you pass string inside Objective-C and NSLog(@”%@”,birdName); which is just an equivalent of trace in AS3 and the most important thing is the [bird release]; method which basically is how the compiler releases the bird instant from the memory, garbage collection is paramount if you trying to build an iPhone application since it has a limited resources.

Now run the code by pressing command-return and open the console window to see the output by pressing command-shift-R, if you are correct you will see the bird name and the “Tweets”.

So that’s the end of part 1 there are a lot of things that can be explained here, by I’ll leave it as it so it’s easier to understand.

And the AS3 equivalent.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package
{
    import com.animal.*;

    import flash.display.MovieClip;

    public class Main extends MovieClip
    {
        public function Main()
        {
            var bird:Bird = new Bird();

            bird.setName = "Polly";
            bird.makeSound();
           
            var birdName:String = bird.getName();

            trace(birdName);
        }
    }
   
}

and here’s the entire code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@interface MyPet : NSObject  {
    NSString *petName;
}

- (void) makeSound;
- (void) setName:(NSString*) n;
- (NSString *) getName;

@end

@implementation MyPet

- (void) makeSound
{
    NSLog(@"Tweets");
}

- (void) setName:(NSString *) n;
{
    petName = n;
}

- (NSString *) getName
{
    return petName;
}

@end

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

    MyPet *bird = [MyPet new];

    [bird setName:@"Polly"];
    [bird makeSound];

    NSString *birdName = [bird getName];
    NSLog(@"%@",birdName);

    [bird release];

    [pool drain];
    return 0;
}

iPad!

Was launched 1 hour ago.

and here’s what people is saying about it.

Imagination is more important than knowledge

A series of internet memes has again sparked another heated debates, first it was the first javascript website showcased in the FWA and later the YouTube- HTML5 integration.

Since the dawn of the internet-era, infinite debates amongst these developer elitists were always inundated the World Wide Web and one of the revered topic is of course who has the better developing platform.

The advent of HTML5 and the mission and vision which it carries is truly spellbinding for the internet community, but if you remember so had actionscript 3 during its inception.

Every technology has its share of flaws.

The impending problem that HTML5 has had to be adaptations and compatibility issues, the browser war will always be diluted by strategic marketing, business goals, and of course ego -which can be dubbed as the company ideology- and never in the interest of the developer.

The first HTML5 conundrum which has begun is the new video which its support is limited to web browsers that support the H.264 video codec mainly because W3C declined to specify a standard video codec to go along with new video element and you can guess it, IE deviates the notion completely and this just the beginning of other impediments which will come along.

Flash, as I’ve had mentioned its flaws and the prevalent hate memes such as the CPU hogger, the battery drainer, etc which all is true, and of course the choreographed demo of Flash player 10.1 in Nexus, was mainly caused by Adobe complacent and other aspect which mainly had to be the economy, the decrescendo of demand in Flash during this post-recession period has been abysmally loud (a bit of oxymoron there) and based on my experience, building a good Flash site needs a bit of an investment in time and money as oppose as HTML/JS sites, hence unless if it’s a niche market such as social-game company, almost nobody dares to invest such luxury or even has the needs that requires Flash to fulfill their business objective, except for that annoying ad banners which I mostly am doing now :(.

But from the Technology stand point, Flash I think can still accomplish, and I’m not trying to be subjective here, something that is better than what HTML/JS does, a few sites worth mentioning are:

http://sketch.odopod.com/
http://www.picnik.com/app

I dare you to build something like that with HTML/JS, but again I’m not trying to devalue HTML/JS here, check out google, digg, etc.

But in conclusion these ridiculous dialogs are unfounded, history has repeatedly shown us that technology is merely a tool, a transient breeze that bound to be superseded by a better and in-your-face contender ergo we shouldn’t be trying to be a platform zealots, I’ve been experimenting with Unity3D, Cocoa, Jquery and of course Flash, I think exploring new Technology is the beauty of this keyboard-cat and Rick’n Roll’d era.

As an epilogue I will depart from this post by paraphrasing some guy with a weird hairdo who invented the theory of relativity:

Imagination is more important than knowledge. For knowledge is limited to all we now know and understand, while imagination embraces the entire world, and all there ever will be to know and understand.



Copyright © 2004–2009. All rights reserved.

RSS Feed. This blog is based from Modern Clix, a theme by Rodrigo Galindez.