Sunday, January 31, 2010

text() in processing and processing.js


I've started to compare the differences between processing and processing.js about how they implement the text().

How processing draw the text into the canvas?

the main idea is: translate the matrix of the text base on the parameters, then draw the text.

Where the code are?

In processing, we can find the code for text() in section TEXT/FONTS of the file PGraphics.java. Also, the translate() can be found in PMatrix2D.java or PMatrix3D.java.
In processing.js, we can find text() as p.text() inside the processing.js file.

Other resource

HTML 5 canvas - the basics - this is the page from Opera that introduce the basics of canvas 2d. It describes how the Text API work, and it also mentions that, "the Text API is only available in recent WebKit builds, and in Firefox 3.1 nightly builds".

Need to solve

  • To implement the 3D Text in processing.js, I need a 3d translate(). However, it is still missing.
  • How to get their codes or the latest code with the 3d implementation? There are many people working on the processingjs 3d implementation. Some of them have made somethings already. They must have a very good idea about how to deal with the 3d matrix.
  • How the canvas work in 3d? I get basics of 2d, but where is the 3d?


Concluded here Today. Will continue tomorrow.

Friday, January 29, 2010

Project plan initialization

This post is about to tell you my work on Processing.js project.

Processing.js

Processing.js is a open source project from processing which in an open source programming language that allow users to program images, animations, or interactions. And Processing.js is a project that inherits all the features of Processing.
Honestly, I am big fan of Flash web application, but I hate the performance of Flash especially when it is running with 3D things. Also, always requiring to install a latest version is a big problem. Therefore, it is amazing for me to see those examples of processing.js. Draw directly to the web page is unbelievable, and it also supports webGL. This is the dream of any programmer.

Where I am

This is my official blog for this project. It is welcome to follow me to received further information as I proceed.
Also, all the code I have done can be traced on google code/osd600.

Release 0.1

Asalga suggested me to pick text() which is already exist. However, we still have a lot of work to do on that until it becomes a member of 3d family. The first thing I do on this will be the comparison of the 2d text() syntax between the processing code and processing.js code.

Release 0.2 and 0.3

Once I done the Release 0.1, I will keep going to the 3d text(). It is difficult to say the detail, but I will post it once it is clear to me.

Things need to learn

Processing source code and OpenGL API - expect to understand why there are OpenGL API calls in the processing source code, and how they were used
WebGL API - this is where the core is
asalga's blog and annasob's blog - see what they have done

Barriers

  • English problem. Oral and communicated skill limitation. Resolution - be prepared
  • OpenGL and WebGL. As this is the basics of what I am going to do, I definitely need to understand them well enough. It will be a challenge, and I expect that
Since I already began reading, I only have one last words to say. Google, blog and time are my best friends.

Wednesday, January 27, 2010

3d in processing

Today, I was trying to build some 3d stuffs by using processing. However, it fails no matter how I try. Let's see two examples:


The first one is done by processing, and the second one is done by flash. They are using the same algorithm so that it should display the same things. However, processing fail on this. I don't know why at this moment, but I try to replace the sin and cos functions and it still does the same thing. Therefore, I guess it may be a problem about <canvas> tag. Anyway, I need try more different codes and what is the problem. So, I think I can work on this on my open source course.^^

Tuesday, January 26, 2010

processing.js

In my today's open source lecture, my professor, David, introduced us the processingjs project.
Here is an example came with the source(IS NOT WORKING ON IE):

It is very awesome. Before I know this amazing project, I thought I was definitely going to join a flash 3d engine project like Sandy or Away3d. However, now I think it is much better to play around with processing. Since I have a full day tomorrow, why not try to use processing to build somethings and see the difference with flash.

Another thing is about how to put the processing works into Google Blogger.
  1. download the processing.js and init.js(not sure if this one is needed) from here
  2. put them into a onlineline hosting so that, in your web page, you can link to them
  3. put the processing code into this tag<script type="application/processing">code</script>
  4. put this, <canvas height="74px" width="900px"></canvas>, after </script>
And then, it should be work. and enjoy it.

Friday, January 22, 2010

my experience in community

On the Mozilla Community lecture, Mike take about the IRC. I happen to have a similar experience like that. I am a technical member in a Flash group on QQ (an instance messenger from China which has a function called group similar as channel in IRC). I entered that group because I wanted to learn something about flash. At first, I was a beginner of flash, but now, I am already a technical member responsible to answer people's questions. I can say I have learned a lot when I ask questions and answer people's questions. Therefore, I have confidence with getting into a open source channel in IRC and I am going to learn a lot.

Friday, January 15, 2010

my thought of "Revolution OS"

When I was watching the video, I was thinking about why there are so many people using Windows rather than Linux. I look arround my friends and myself who like to play games. Obviously, Windows is the only choice for us. Although I could play warcraft 3 on Linux by using wine, but we all know that the performance of that is not that good, and it is difficult to the beginner. Why there is not a good-looking game on Linux? Why EA games don't run on Linux? I think none of a game company will open their source code. Second, I like the way how Linux work - programmer are available to modify the source code, to fix a bug and so on. But it is not easy to find a program and install it sometimes. Rather than that, I like the way how windows work - double click, next, next and finish.
Bazaar brings us the freedom and free software, and Cathedral represent convenience. Freedom is good, but I don't need the code of the software in my daily life. Thereforce, for now Windows is still my first OS choice and I will keep using the opensource software.

subtitles of "Revolution OS"

I am feeling a little bit different to listen every word a hundred percent clear for the video. therefore, I found the subtitles from here.

Download the video into your harddisk. In the same folder, create a new text file call that as "Revolution OS.srt", then paste everything inside that web page into the file. and load the subtitles when you use the player to play it.

hope it is helpful for whom need it.

who am I?

Who am I? Well, my name is Zhibin Huang. I am an international student from China. I came to Canada last August (in the year of 2008). I am focusing on c++ and  flash actionscirpt. I also like to play game during my spare time. and like to make friends. hopefully we can be friend.

Thursday, January 14, 2010

Hello, Open Source!

Two years ago, when I first heard about the open source, I never throught about I could get involve in it. What will happen when I encounter the open source? I don't know it, but it must be fun.