XB PointStream 0.4 Release!

So, I haven’t really talked about my new project a whole lot and now I’m going to change that. This is somewhat a pre-emptive release blog as the release isn’t really finalized and probably won’t be until early next week. I just really didn’t know what to name my blog.  I, also, apologize in advanced as this blog will not be very visual… but feel free to click on the links and I’ve also got a sample demo of the PSI file reader below.

Anyway, XB PointStream is on a good course and we’ve got some functionality working with it so far.  Andor Salga will be implementing items like streaming asc files and webgl arrays for this upcoming release.  As for myself, I’ve been working on PSI files and reading them for the past few releases.  I’ve included the framework for reading PSI files and the XML tags used for said files.  It reads the binary in the file and puts it in a variable for now.  I’ve got a sample demo of it in action (note: due to the size of the file, it does take several seconds… the “test” word will turn into ascii binary).

So I’ve implemented the framework, but the actual conversion of the binary will take a little while longer to implement.  Mainly, it’s due to the fact that I still have to decipher the reader they gave me and make better sense of it to finally convert it.  It’s probably going to take a few more releases before I get a finalized working version.  There’s also still plenty to do in the meantime though.  Like with the current release, I’ve also implemented a few easy functions.  One was a simple default function that sets some of the variables back to their default values.  The other was taking sephr‘s tinylog lite logger from Pjs and put it into XBPS, so that we have a simple logging mechanism.  This will probably be changed later to our own custom one, once we have time to implement it.

I’m going to leave you with a bunch of links relating to the project:

Wiki Page – clickity
Github Repo – clickity
Ticket System – clickity
Twitter – clickity
Blogs – clickity

Key stress

For the last week and a half, I’ve been working on making Processing.js (Pjs) keys and keystrokes work more like its Processing (p5) counterpart.  Actually, it was originally already set for review but the reviewers didn’t wish to implement browser detection.  So, I’ve been focusing on feature detection for keys within Pjs.  Now this fix doesn’t seem very hard, only if the browser vendors actually standardized their key presses and key strokes.  Instead, they like to use the method of “ours is better, so do it our way”, which isn’t very helpful to the developers.  I’ll explain my situation and why I’m so stressed and frustrated about this particular fix.

Key codes are not a particular problem within this situation.  Most of the keys/code values are either similar or there’s already existing code to account for different codes.  Not something I’m worried about in terms of Pjs.  Key strokes and repeating is the bigger hassle in this.  There’s also the fact that some browsers use charCode instead of keyCode or vice versa.  Those two combinations by themselves can create a huge mess.  I’m just glad the actual codes aren’t completely different as well, or this would be an even bigger headache.

I’ll start off by saying that there’s three different type of key press events. First is keydown, when you push down a key. Then it’s counterpart is keyup, when you release a key. The last is keypress, which determines if a key is being held down. Coded keys are keys in the keyboard that can alter the given keycode when a key is pressed. The five main keys are Ctrl, Alt, Shift, Caps Lock and Num Lock. Char keys are essentially anything that can produce a character. The movement keys allow movement through the document and then there’s the F keys.

Difference in Key Strokes and Key Uses
Processing Firefox Chrome
char keys refires all events when key is being held down char keys refires keypress event when key is being held down char keys refires keypress and keydown event when key is being held down
coded keys do not get refired when being held down, keypress value does not exist coded keys do not get refired when being held down, keypress value does not exist coded keys do not get refired when being held down, keypress value does not exist
movement and f keys refire keydown and keyup events when held down, keypress value does not exist movement and f keys refire the keypress event when held down movement and fkeys refire the keydown event when held down, keypress value does not exist
All platforms deploy keydown event when a key is pressed and keyup event when a key is released.

They may seem like minor differences but setting them from two differing places to one uniform place creates a lot of problems.  When I was correcting small bugs that came up, another one would pop up and it just kept going until I lost track of what fixes I did for certain bugs.  I’d end up having to restart from a clean slate to begin the comprehension again.  Anyway, I know people are looking to get this working properly as I’m getting hits on my blog about keys in Pjs.  I’ll make sure it gets in before 1.0!

Toronto WebGL Community

Left to Right: myself, Benoit, Andor and Matt

This is the Toronto WebGL Community!  Or at least the people we know that currently actively work on it…  if there’s more of you out there, feel free to let yourself known and get involved by posting on the comments of this blog.  I’ll make sure the right people see your stuff.

Anyway, this picture was taken at the Mozilla Toronto Offices.  Yesterday, I spent the afternoon with some of my co-workers talking to Benoit Jacob about the WebGL implementation within Minefield.  We were doing some profiling and giving feedback on what changes could be made to provide better support for those using the WebGL API through Firefox/Minefield.  So if any of you have suggestions, specifically more about how it’s implemented in Minefield and less about the actual WebGL standard, feel free to leave a comment below and I’ll do my best to get the idea to them.

I, also, learned a couple of neat tricks.  One such is a built in profiler in Linux that I could use on my desktop at work.  It will make bottlenecks a lot easier to find.  The command is perf record, which actually only came out to Ubuntu on a recent release.

We discussed other performance boosters, like TypedArrays.  This is a new proposal to the Javascript language and will be somewhat monumental considering JS is a type-less language.  This introduction will help improve WebGL code and will pave the way for the final release of WebGL.  It just has to be approved by the standards committee.

***NEW*** Toronto WebGL Mailing List (created by Benoit) – clickity

createGraphics 3D (PGraphics) working!

I actually got it working last Tuesday and the working example of it has been up since then.  I just wanted to polish it more and maybe make a different example to show the process in this writeup.  However, I’ve been busy since last Tuesday and prolonging this announcement seems unwise so I’m just going to go with what I have.

createGraphics now runs with a 3D environment!

Note: you need a webGL enabled browser to see 3D

After a couple of months of thinking and deciphering the brilliant hack that John Resig put in for createGraphics/PGraphics, I finally got its 3D counterpart working.  Actually, it wasn’t really a couple of months… maybe altogether about 2 straight weeks.  I’ve had to test whether it was possible first and the results were very good.  It also helped me file bug 571061 with Mozilla.  Once I had it working without Processing.js (PJS), I knew what the process was to get it working with PJS.  At first, I implemented it with pre-existing canvases.  Once that worked, I changed it to work with dynamically created ones.  It turns out that I was already really close and in the end the code only needed a few modifications.  And now we have createGraphics working with the 3D scope as well!  Maybe I’ll put up a better example sometime soon involving great uses for this new feature, like mirrors suggested by F1LT3R.