Friday, January 15, 2010

‘Release‘ 0.3 A mash up of mash ups.

After trying to follow in the steps of 2 Students aka Andor Salga (asalga) and Anna Sobiepanek. They have working 3d demos. I on the other hand do not have demos anywhere near as fascinating as theirs. I ended up getting so frustrated with not being able to merge my code with anna’s processing file, it ended up turning into this disaster. Then I come up with the brilliant idea to just rip anna’s demo off totally and make some minor changes while adding my function calls. After I don’t even know how many days, I end up with this abomination. At this point I’m ready to give up, I figure “you know what?… I might as well just do it the way java does it”. After about 1.5/2 days of converting the Java processing class called PMatrix3D to JS, I’m in IRC and someone links me this.

Serves me write for only keeping up to date with Andor and Anna’s blogs. MinyXO had already made a beautifully converted PMatrix3D set of functions. Once I recovered my monitors pieces and put them back together (not mad at you MinyXO, mad at myself.) I tried to see if MinyXO had come up with a working 3D demo I can try to get working with my code. Sadly he wasn’t focusing on any 3D demos I can learn from.

It is at this point I decided to go back to these tutorials I found way back at the beginning of this 3D stuff. As opposed to just submitting nothing and making all excuses as to why it’s not so bad to take another course next semester, I decided to focus on that tutorial. My train of thought was, learn how the webGL stuff works, then I can write this function in JavaScript and at least make it work in a webGL-only environment. The good thing is that I learned a bit more and have some point of reference to show where I am in understanding this 3D stuff. The bad thing is, I picked the tutorials source files from lesson 1. The most basic. This leads to a whole bunch of other problems I outline in my Tests below.

0.3 Deliverables

  • Wrote this blog!
  • Have 2 sets of 3 demos that demonstrate where I’m at in understanding webGL:

Code Tests

ModelX modelX()

ModelY modelY()

ModelZ modelZ()

ScreenX screenX()

ScreenY screenY()

ScreenZ screenZ()

My thoughts about 0.3 and future releases

Even though I’m not a student in the following course OSD700, I hate leaving loose ends. What I hate even more is not understanding things and moving on to the next subject/semester. The beauty of this open source course is that it’s existence is almost completely virtual (except for the registration payment). This will allow me to remain connected to the community and continue to learn and find out ways I am able to contribute.

One thing I must point out is the desperate need to develop some structure to put in place to unify all the different versions of the processing code that exists. There needs to be a new core file(s). Just as we started processing-js when it had only 2D functionality, as a group we started by feeling our way through this new code and experience. Now that we are hacking out this “3D” functionality, there needs to be a new core file updated with everyone's 3D stuff merged and organized and accepted as the new standard we all pull from. Looking to see if other students had certain functions created in their Git-Hub forks was a disaster that wasted more time then anything else.

A second idea that I think may allow going through processing-js code a bit easier, is if we start putting different types of code into different files processingjs.js is getting bloated. In the Java version of processing, most 3D functions are in files that have 3D in the file name Ex: and are a completely separate file.

Also, Andor organized a meeting when we started the 3D functions and I think there is a lesson in that. Having meetings like the one Andor organized once in a while is super powerful. IRC is great but it’s nowhere near the same as meetings in person.

Link for Dave back to my Cdot

Saturday, November 21, 2009

0.2 Release

Unlike my 0.1 which was very late, I’m going to go against my way of being, which is submitting things only when I think they are 100% working or good enough to show. I found out today that Edward Sin submitted a function called HashMap (I didn’t even know he was in the class still.).

That so happens to be the same function I posted about on Nov. 12, 2009 on my blog. It’s great that he’s done, I was just ticked off I wasted time on it (I’ll get over it). On a go forward basis, we should check peoples blogs to see what functions they are going to work on for their next release or come up with another structure to avoid this if blogging/lighthouse isn’t enough.

The functions I will take credit for on my 0.2 release are:

0.2 Deliverables



loadStrings()  -Still need to get it working with URL and local storage address, Null is what 
                      it keeps finding. (should find hack by sunday.)

deleteStrings() – Can’t be 100% sure it works until loadStrings works 100% to confirm the deleted address.

Functions I could not get done because they are 3D related              (pushed to 0.3), or I needed more time are:

saveBytes() –Setting Sunday as goal

loadBytes() –Setting Sunday as goal

deleteBytes() –Setting Sunday as goal

For 0.3




mouseX() / mouseY()


By Sunday I also plan to have all the corrections F1lt3r gave me on reviewing my functions for 0.1

They will also be pushed on git back for final review to officially put into processing.js.

Friday, November 20, 2009

Back to processing ^^

I spoke with Andor and he showed me why it's in my best interest to save doing 3d functions for 0.3.
After going over the Mozilla Wiki Tasklist, I started freaking out

"OMG all the easy functions to work on are gone... Noooo!!" *mashing face on keyboard*

Then I got a bit positive and seen functions like:

None of the above functions were implemented into processing except loadStrings().
I looked in processing.js and found that loadStrings() was somewhat started because it accepted a URL, but it didn't have the JUICY part which is loading strings from a file.
       As most of you processing peeps know, you can't read/write to a file with JavaScript alone. So me being the brilliant computer science student I am, I started scheming,  trying to find a diabolically clever way to get around this (I don't know why my brain has to go against the grain. It screws me over in a lot of things.)

*I'm guessing this is about the point visitors lose interest  //posting picture*

*so are you refocused ;)  *

I started looking into PHP. I figured I can make javascript redirect to a .php page using the post method. Then in that post request I can stuff in a whole whack of data that I can then make .php store to a file.
To get the info back, I would repeat the process having the .php file send me the strings back using post.

I was so happy, I thought I had all the angles covered so I went to go speak to Dave  <- click it once

(thats when Chris Tyler helped me connect to the Mac. Thanks so much.)

I told em my idea all excited, thinking he would be like *wow... ya thats amazing, can't wait to see it.*
2.7 seconds later, Dave says "No no no, forget the php."

(he's not actually that mean)
Instead look into something called localStorage that is new in html5. Dave also directed me to another link and with that, I was off like a kid with A.D.D. in a Toy's-R-Us.
After randomly skimming pages with superfluous explanations, or so many dead ends, I stumbled on this amazing page.

*keep you engaged  Picture 2*

Now I started working on the saveStrings() and loadStrings() and I know I'm going to have to add a deleteString()
// to remove all/any of the items  accumulated into localStorage.removeItem('what ever');

I hope F1Lt3r doesn't hate the idea of using localStorage :(

ZOMG finally connected to a Mac from Windows 7 using VNC.

I know this is out of left field for everyone except me, but I like doing little side endeavors to spice things up. For a lot of people this probably seems like a no brainer, and if it is, then you can stop reading because this is just me patting myself on the back.

To the rest of you who think it would be pretty cool to connect to a Mac computer using windows, the following is a small guide for other Seneca students who have access to this same hardware as I do. (Although the concept is what matters.)

You will need the following:

-Putty (ssh clicent)

-VNC viewer   (<- I used realVNC on a windows 32bit system)  other OS’s use their download page.

-a Mac computer you have access to with a vnc server installed.


-Open putty.

-Under Session(on left) find HostName and enter the server you want. In my case it was the canada server.

-Under +SSH (in left panel) open the menu and click tunnels

-In destination enter

-In Source port enter 5900

-click Add

-Click Open             *you will have a black login screen.*

-If you logged in successfully   then that means you have started your tunneling into the remote computer over port 5900.   *pretty cool eh?*

-Just leave this window open until you are done with the remote computer.

Now to connect so you can see the desktop:

-Open realVNC      

-Under VNC Server enter the following: localhost:5900

-Click Connect

-enter your account password for the account you have on the remote machine.

-BAM!!! you should see a new window open :)  VUALA!  *Halo3 music starts playing*

-Note When you log into the mac from the screen above, you may be disconnected because while logging in, the monitors resolution changed. To fix this, just reconnect and you will be on the Macs desktop.

Tuesday, November 17, 2009

Starting 0.2 with reverse()

So far this reverse function is as easy as it sounds. Take an array and flip it around so that the first element becomes the last and vice versa. For the most part it’s done, but I get bothered by little things. For example on the processing page, reverse displays the array but with no comma (,) separator EX:

String sa[] = { "OH ", "NY ", "MA ", "CA "};
sa = reverse(sa);
print(sa);  // Prints "CA MA NY OH "

In my java script output it looks similar but with “,” that keep being put in  Ex:

The output should be: BMWVolvoSaab   :(

So far I’m trying to use a regExp to search for “,”  and replace with “” but I’m getting an error.

This post is also just to get into the habbit of blogging because I havn’t been doing it enough in this course and I don’t usually think this kind of stuff is a blog worthy post.

Friday, November 13, 2009

Corrections on 0.1

nfp() is now working exactly as the java version works. Check it out.

Link to my text file showing source code has been fixed. I want to make a patch like Andor has but for now F1lt3r check it out.

Thursday, November 12, 2009

0.2 Release functions

- reverse()

- Hash Map

- screen

- screenX()

- mouseX & mouseY  are under the bug section of the wiki task list so I want to talk to teacher before I commit to doing this one.

- modelX()  I want to discuss with teacher before I commit to doing this one.


I also need to correct to correct nfp() when 3 parameters are used.