Hello world!

•October 8, 2007 • 1 Comment

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Bokie AIRMaps

•August 14, 2007 • Leave a Comment

Was feeling kinda bored at work today so decided to just cook something up. Mainly just a random experiment with Yahoo Maps! and Flash CS3 compiled against the AIR runtime. I hope AIR will be released as a full version soon. The beta version is already showing so much potential!

Keep the good things coming Adobe!

Bok’s Story

•August 14, 2007 • Leave a Comment

Weikie was kinda bored with work so she decided to draw an animation of me slimming down to the extend of being able to float and raise up to heaven. I must say that she is a rather creative girl!

She calls it, Bok’s Story.

Check it out!

I got (Laid)els!

•August 12, 2007 • Leave a Comment

This happens awhile ago but I haven’t got the time to blog about it. (Rather I am too lazy to do it ho ho ho) Then today when I was halfway through my entry, lighting struck my place and the power tripped!! F**K!! 0_0″ well never mind, I will just start all over again.

I was away from my desk one day and when I came back I saw this!

Then I reach down to insert a CD into my PC and this!

Ah!! still I thought nothing about it and reach for my water bottle and…

check out my mouse and calculator as well!! 0_0″” What is going on? I got up and took a step back and..OMG…


I reach out for my watch and…AHHH!!!

hmm…looks pretty good actually

Then the culprit walked up to me and…

Help me!!!

*Weikie standing at aside grinning away ^_^*

Cell Shading

•July 13, 2007 • Leave a Comment

My first livejournal post and guess what, its gonna be about HLSL!!!! :) After reading about implementing cell shading with HLSL, it doesn’t seem that hard at all. So I went off and started giving it a shot.

Half an hour past and I still can’t get it right 0_0″. Although I did get the abrupt lighting effect expected from cell shading, but the color doesn’t interpolate that well on my mesh. What the heck I thought, I will just move the lighting equation to the pixel shader instead and see how it goes. Presto! It turned out to be perfect and now I have a Cell Shaded teapot mesh!

My little teapot!

私たちは同じ空をみてるのかな?

•May 13, 2007 • 1 Comment

May, 13, 2007, there is some comfort in the emptiness of the sea… I subjected myself to the openness and was reminded how insignificantly small my existence is. I stop kayaking and lay back thinking… 私たちは同じ空をみてるのかな?….

“Bok, we should head back, its gonna rain”…

Sunshine!

•April 13, 2007 • Leave a Comment

I was trying to model a sun in DirectX after watching the movie Sunshine and the first step I decided was to load up a sun texture which I can then map onto a sphere as the sun. After looking around for awhile, I found the perfect textures from the sample code package of the book Introduction to 3D Game Programming with DirectX 9.0c, A shader approach. There are two textures in use. A flat texture of a fireball and an alpha map. I would need to do a component multiplication from the texels of both textures to generate the final texture. Excited by my findings, I started working on a prototype sun immediately.

The textures were great but I figure it would be better if I could rotate the textures to mimic the sun’s flare on its surface. Sounds like a simple task but for the last few hours my head was the one rotating in all axis instead! It seems that the origin of the texture is not at the top left conner but at the center of the texture instead. A simple translation matrix fixed this problem and finally my texture is spinning…but it is still not spinning at its origin! Then I realize what I did wrong. The positive y-axis for texture coordinates points downwards and not upwards! Ouch! A quick fix to my translation matrix and my little sun is now alive!!

Just to give you an idea on what I was working on, have a look at the images below:

Fire Texture

Alpha Map

Final Image

Sunshine! :) The final texture was mapped onto a plane for now, its almost 3 in the morning and its time to catch some sleep before the actual sun raises!

A Walk To Remember

•April 5, 2007 • Leave a Comment

I was not joking when I told Dery and Yani that I was going to walk from Serangoon MRT station back to my place. It was half past midnight and the night was cooling. It had been an eventful day. A meeting in the morning that went pretty well, met up with Lirong for lunch, got some advancement with my research on Symbian programming and watched Shooters, which turned out to be a pretty good movie.

Along the way, I can’t stop thinking about things that had happened for the past few years in my life. Memories that I thought were forgotten, surfaced and I realize how long it was since the last time I allocated some time for myself. All these while, I’ve spent almost every bit of my free time keeping up with latest technology and updating my skill set, I sort of forgotten that life is more than just bits and bytes. This was when I realized, I’ve let my passion burnt myself out…

I remembered the first time I spoke to her on IRC. How I used her initials to save my highest score for the game Street Fighter 3 in the arcade. The time when I hid myself in my father’s pile of books and spoke to her on the phone till the wee hours in the morning. I remembered the first time I held her hand. It was a rainy day and I pulled her close to me. The trip we made to Singapore with her cousin. We missed our bus back and how upset she was. I remembered how she cried her heart out when our relationship ended…

I remember how we met in OpenGL lab session and how I taught you to draw the first 3 lines from the origin. Each line for each channel, red, green and blue. I blushed when you pay me a compliment. How I was too shy to say hie and quickly looked away when you greeted me in another lab session. I remembered the time we spent at St Kilda, cuddling and keeping each other warm in the blistering cold. We had breakfast at Mcdonalds and I held your hand across the road. I remembered the time when you rushed back from your friend’s place, straight to my room and told me that you missed me so. I can still remember clearly, how accelerated my heart rate was when I stepped out of the airport to visit you in Melbourne…

Soon, my heart was filled with the love that I once had. I read in a book that in order to mend a broken heart, I would have to look back. Search for that warm and soulful spark that I was once so accustomed with. Only then will I be reminded of how wonderful a relationship can be. Only then I will be able to open my heart to others once again. The more I submerged myself in past memories the less angrier I am with myself. I guess, what was written in the book is true…

For the first time in the past few months, I was relax. I’ve grew to understand myself a little more today. I’ve come to terms with my weaknesses and my mistakes. Maybe it was YOU, whom I’ve lost faith in, after failing your last test placed upon me, decided to extend your guidance towards me again. Maybe I should walk more often instead of relaying on public transport…

I guess sometimes you just have to look back to proceed further forward…

[Back at home]
Aha, the intensity of my diffuse light is wrong. I perform a quick fix and my Direct X application is up and running correctly again.

A perfect ending to an eventful day and a brilliant start to a better tomorrow.

The rough road to Symbian Programming

•April 1, 2007 • Leave a Comment

For the past 2 days I’ve gone Symbian mad. I think the last time I didn’t sleep for 2 days 2 night straight was when I am studying for one of my exams in Uni. Yet I felt that it is worth it ;) After reading through tons of PDF files downloaded from Nokia Forum and forum threads, I have only one advise for newbies: “PATIENCE”.

If you are new to C++ then start learning it from the ground up, many concepts used in Symbian programming require one to be rather familiar with C++. Especially strings (strings in Symbian programming is implemented using descriptors), pointers and the MVC design pattern. Anyway I’ve decided to pen down some tips to get anyone started on Symbian C++ programming.

Tools:
1. Carbide C++ Express Version 1.1
2. S60 3rd Edition FP1 SDK
3. S60 3rd Edition MR SDK
4. S60 2nd Edition SDK
5. UIQ SDK

*Very Important: install the SDK(s) and Carbide into C drive! this is actually not necessary but trust me, it will save you a hell lot of trouble for the time being.

Get yourself familiar with the following:

  1. The internal workings of the emulator.
  2. The AKVON framework
  3. MVC design pattern.
  4. Descriptors
  5. Symbian Exception Handling Feature (Cleanup Stack)
  6. Pointers

Get yourself familiar with these two command line tools:

  1. bldmake.exe
  2. abld.bat – created after bldmake.exe is run.
  3. devices.exe
  4. epoc – launch the S60 emulator

I will not go into what these command line tools are used for, after you have downloaded the SDKs, run the PDF that comes along with it. One thing I learn from my little Symbian Adventure is read whatever document that you can come across, even those readme.txt that you wouldn’t normally bother with.

After you have downloaded and installed the tools, go through the steps describe in the PDF that comes along with the SDK to verify that you have installed the SDK properly.

*Very Important: the PDF will tell you to run the abld build command as “abld build” but this might not work. Instead, replace the command with “abld build winscv udeb”

Potential Problems:
1. If you have Direct X SDK installed into your machine and have it path added to the PATH environment variable, check to see if the path has double quotes surrounding it. The epoc command line tool that launch the emulator will not work if there are quotes in PATH. (This took me ages to figure out….:( )

2. To build for the emulator, you would need to compile your code against the WINSCV platform (don’t worry if you do not understand what WINSCV is all about at this moment, just note that you have to compile code against the WINSCV platform if you want to run it in the emulator. The command “abld build winscv udeb” build a debug build for the WINSCV platform.

3. RUN “abld build winscv udeb” AFTER YOU HAVE INSTALLED CARBIDE!!! the compiler that is used to generate a winscv build is shipped only with carbide or codewarrior (another popular IDE)

3. Strangely enough, I encountered incredible hardship trying to get the abld to build against WINSCV successfully. In fact, I still can’t get it to run from the command line! If you would like to try, make sure that you set the EPOCROOT env variable, its highlighted in the PDF that comes along with the SDK. (See what I mean when I say..READ EVERYTHING!!) I miss that out and it caused me a minor headache.

After doing that, you would need to set up a couple more environment variables!!! And it is not documented anywhere!!! Until I met someone on the forum who pointed me to the right direction. Take a look at this thread. If after this you are still unable to compile against WINSCV successfully from the command line, don’t bother! You might as well use Carbide C++.

Problems encountered with Carbide C++

Changes made to MMP files does not take effect in Carbide C++
Now we come to Carbide C++. Before I proceed, let me introduce two files, the bld.inf and .mmp file. Each project must have a bld.inf and .mmp file. I will not go into what this two files do as I am sure that you will be able to find plenty of documentation explaining their function. What I want to point out is that Carbide C++ does not automatically update the mmp file nor will it ever detect any changes made to it!

One usage of the mmp file is to tell the linker to link to a library file. If you add a LIBRARY entry to the mmp file in Carbide, it will not pick it up! What you need to do is go to Project->Properties->C/C++ Build -> WINSCW C/C++ Linker->Libraries and add any additional libraries here. Once again, do remember that the mmp file is not updated, you would need to right click on the project and run the “Update Symbian MMP File…” option. (It seems that Carbide.vs for the Visual Studio does this perfectly??) But remember! this update is just for consistency purposes only. So that you can pack up your project code and run it on another machine. I heard that the folks at Nokia is sorting this problem up with the up and coming Carbide C++ 1.2. *You can however make changes to the MMP file and reimport your project in Carbide C++ for the changes to take effect but I find that rather troublesome :( )

How to create MBM file in Carbide C++?
Another problem I encountered with Carbide C++ is creating MBM files. (yes, in Symbian programming you have tons of files that are meant for different purpose) A MBM file is a format that Symbian used to load bitmaps. Basically if you would wish to load a bitmap in your application, you would have to convert it into a MBM file. There are command line tools that you can use to create the MBM or you can include a couple of lines of entries into the MMP file and the MBM file will be created in the build process. However we have the problem of Carbide not picking up changes made to the MMP file! What can we do then? Easy! Just go to File->New->MBM Definition File. This will create a MBMDEF file. Carbide C++ uses the concept of MBMDEF to create MBM files and trust me this is a hell lot easier to use then the command line tool or defining it in the MMP file.

Another issue that beginners might face is, where in the world is the MBM file after it had been created! It is actually created in the Z drive of the simulator. C:\Symbian\9.2\S60_3rd_FP1_5\Epoc32\release\winscw\udeb\z

To have the MBM file created in another location, go to Project->Properties->MBM Compiler->General options and enter a path to the “Target Path” text field. For example, I entered “resource\apps\test2″ and my MBM file is located in C:\Symbian\9.2\S60_3rd_FP1_5\Epoc32\release\winscw\udeb\z\resource\apps\test2. Carbide will create any folder that does not exist.

Where in the world is the MBG file!
Another file! A MBG file! Basically several bitmap images can be packed into a single MBM file. A MBG file will then be created alongside the MBM file and it contains an enum structure that contains the ID to each image in the MBM. You can then include the MBG file in your code and use the enum to load the specific image. The MBG file is located in C:\Symbian\9.2\S60_3rd_FP1_5\Epoc32\include. It is just a text file that you can use notepad to view the content.

iEikonEnv not defined
If you are starting out with some sample code, you might encounter iEikonEnv. after copying and pasting the sample code you might encountered an error that inform you that iEikonEnv is not defined! To solve this problem, you have to include two files “eikdef.h” and “eikenv.h” iEikonEnv is not a variable but it is actually a cast to iCoeEnv.

Phew that was a long post but hopefully this will be able to help beginners sort out some problems that they might encounter. The CleanupStack and Descriptors are extremely important concepts to grasp if you are serious about Symbian programming. If you have any tips to add, feel free to drop them here :) Until next time, remember, patience is the way to Symbian programming.

Pandachan!

•March 24, 2007 • 1 Comment