Unfinished Business 0.8 – 0.9 – 1.0

This post is looooonnnnngggg overdue, considering my last post was in March.  I figured I could do this while Minefield was building (but I was wrong considering it only takes like 20 mins for it to build on these machines).

0.8 Release

I really didn’t do all too much for the 0.8 release.  I was busy with other things.  I realize, now, that I should’ve thought more importantly of this project and should’ve made as much time as possible for it.  Unfortunately, there’s not much I can do about the past but learn from it and dedicate my time better.  I did feel badly for not doing as much for the 0.8 release as my colleagues were depending on me and hopefully made up for it somewhat with my work with the 0.9 release.

0.9 Release

For 0.9, I worked on beginShape, vertex and endShape.  I had a barely working product for 3D (untested and unused) before the Processing.js workshop.  It was barely working due to the fact that my changes broke the 2D version.  During the workshop, I was able to run tests and completely revamp the way beginShape/endShape worked.  With the 2D version, the functions were set to draw as the vertices were put in.  I changed it so that it collects that information and then renders at the end.  I, also, spent a whole day on fixing bugs and testing the code.  This was needed due to the fact that it was a large amount of code.  My examples and tests can be found on at the following link:  click here.  (Note: that 3D tests and demos require a pre-release browser that supports WebGL… such as Minefield, Chromium or Webkit).  Here’s a more prominent 3D demo using beginShape/endShape (again you need a 3D capable browser):

After that weekend, I was able to work on converting 2D quad and triangle primitives to work in 3D space.  This wasn’t really too tough as it was merely a wrapper

1.0 and Future Releases

1.0 is a goal for the end of May… however, we will be doing mini-releases along the way to sort out some fixes and release some more needed features.  My first goal is to make that RGB Cube demo working up to speed.  This entails converting a bit of the current endShape code to take in colours for the vertices and render them.  I, also, have to make sure that these objects take normals so they can be lit up in a 3D environment.  After, I plan to work on the PGraphics object and make sure that the fix works with 3D objects being displayed in createGraphics.  My final plan of action before the 1.0 release date is to ensure the PShape datatype is working within the PJS environment.  Of course, I’ll also be fixing any bugs that come along the way.


0.7 release

I was a little hard-pressed for this week’s release.  Mainly because I thought the release to be next week.  I did have some stuff done before but I wasn’t in much of a rush to finish it, until I found out it was to be out this Monday morning.  I got in gear but still had much trouble with beginCamera() and endCamera().  The functions you see there seem pretty simple but having to use the inverse of camera threw me for a loop.  I had to look for the problem everywhere in the code.  At one point, I rewrote the whole invert function only to find out it was working properly.  Some key objects I was missing were dependent on deprecated functions.  At least, the code within the Processing native said they were to be removed from the future.  In that sense, my colleague decided it wasn’t needed in PJS.  I quite agree with him still.  It’s not completely needed, some of those inverse functions anyway.  I could and will probably recycle some of the regular functions and just apply the inverse.  I did add them all for now though.

That’s not all there is to it either.  As I was submitting an example through git, I found a bug that still currently resides with my checked-in code.  It may seem like it works properly, but insert a camera() function in there and the changes don’t take.  That is definitely a problem because suppose it’s put in a draw{} statement.  It wouldn’t have an anchor that can put it back to place… it’ll just continue to transform.  It’s somewhat of a big bug that I can’t finish tonight.  I’m leaving it up to the reviewers to pass or fail.  I doubt it’s going to pass… I’m not sure I would pass it either.

On a lighter note, I was able to finish the dist-3d days ago.  I was just so wrapped up with beginCamera() and endCamera() that I never wrote the tests for it.  I wrote my first unit tests earlier today and it was a breeze.  I’m definitely glad that was added to the PJS scope.  It definitely makes unit tests much easier.

Anyway, off to bed.  Maybe someone will have read this blog and figured out a way to help me with the camera.  Dave was right.  It was my fault for waiting til the last second to ask for help.  I’ll blog more soon… still have to get PGraphics off the ground.

Back to work

I’ve just finished reading week and it’s time to get back to work.  Getting back into the groove is always hard, including blogging again.  I realize it’s been a while since my last post and it was mostly due to midterms and hell week.  This is going to be a long post due to having to wrap up previous releases and talking about the upcoming 0.7 release.  I won’t make this intro too long so I’ll just get on with it…


In this release, we got 3D up and running!  It’s fairly old news but exciting nonetheless.  I’ve taken some of Corban‘s examples (which he was using to show if the functions were working or not) and put them on my matrix account.  This first demo was a test with translate and how it was working improperly when first put in (please note that you’d need a WebGL enabled browser to view 3D… like Mozilla’s Minefield).  It has been fixed and is currently working within that demo.

The picture above is a comparison of Processing and Processing.js.  It links to the other demo that previews the ortho() function is working as intended.  And by that, we mean it’s working exactly how Processing is doing it.


I didn’t do too much for the 0.6 release.  Like I said, I was a bit busy with midterms and assignments.  I did try to do what I could and pitch in where I could help.  I did more than half the peer reviews submitted.  I’m not going to list them all since there were so many… but almost all of them did end up getting checked-in so you can look through this list if you wish.

I did add one function, applyMatrix().  It wasn’t a tough one to add… it was mostly just a simple wrapper but I didn’t expect some of the complications I did have.  I ended up making a demo/example to make sure it worked properly.  More details about my problems can be found here.


For this upcoming release, I’m going to finish beginCamera() and endCamera().  So, we can have some 3D Camera movement.  I’ve already got an idea of how this can be implemented involving the modelView and cam matrices.  There maybe even some use of the 3d matrix stack that I’ve previously created.

I’ve also added two more items to put in for this release.  One is to implement a working dist for 3d.  This should be fairly simple by using an existing PVector.dist() function and wrapping that to work with this.  The second is an important function which I’ve yet to determine if it will be easy or hard.  Mainly due to my not having that much experience with this particular problem.  I’m going to implement the much needed PGraphic.  Now, this could be very elaborate or as simple as recalling the p object into a buffer.  I’m going to talk to Corban/F1LT3R/humph more about this particular function/object.  I’m not exactly sure on where to start either.  So, that would be some good advice to begin with.

Well enough chit-chat… that’s my update and it wasn’t as long as I thought it would be.  Now back to work…

Mistakes and new functions

In my previous post, I was doing some tests.  Somehow, be it tiredness or plain out carelessness, I messed up one of my tests and forged ahead on a commit.  Luckily it was caught by Andor, and a bad release was avoided.  Then again, that’s what we have peer-reviews and super-reviews for.  However, I was able to find the problem and fix it… still the same old problem with the variables not updating once a resize is called.  It seems that I forgot to update an important variable.  I also took some time to test for the ortho function (since it was easy to change one line).  I added that update to the repo as well.

As can be seen above, the outputs are the same as what would be done in Processing.  I have also added in the necessary variable names that Andor was looking to use.  I’m still working on the current matrix stack and hopefully can get the testing finished either today or tomorrow.

I adapted PMatrix3D into all the camera functions already as Andor is working on it and should come out with the release at the same time as my functions.  I am a little concerned with how he implemented PMatrix3D though… it’s not an object, unlike PVector.

Testing camera, frustum and perspective

Anna, our new project manager, was doing a follow-up on me yesterday.  She brought up a valid point of me not blogging enough (which everyone already knows as well, if you’ve been following anyway).  I was stuck on a problem the past few days and just let it go, as I was busy with other things.  But I realize that if I blogged about it, I could have gotten the answer while I left it alone.  I did find the problem when I threw it out on IRC and people read it and provided feedback.  I ended up filing a bug (267) for the problem to get looked at in the future.

Anyway, I did get my tests done and the results were working as intended… and by that I mean my matrices were lining up with what Processing has…

I’m still thoroughly testing PMatrix3DStack… as there’s not default tests with that, I’m just plugging in some random numbers.  The biggest concern is mult… if it’s being multiplied properly.  If I can finished PMatrix3DStack testing tonight, I should be able to write a test for ortho() as well.

Triaging and Reviews – Release 0.4

With the recent finish (or almost finish due to one last ticket – linting), I figured I should write a blog post about it… considering we’re supposed to blog about each release… anyway, I also figured I’d start to set an example for Dave’s new students (whom I told to take the class), who are new to the world of blogs.

I took on a number of tickets for peer review.  Tickets #: 1, 42, 60, 61, 171, 188, 205.  Luckily, most of the code worked and had tests… so making sure they worked and the code looked simple and easy to read wasn’t too hard a task.

Ticket #1
This ticket was the first one inducted into lighthouse and it still hasn’t made the repo.  It was my job to make sure it passed.  It wasn’t very hard considering all of Daniel’s code looked great.  He did have an old test that wasn’t working anymore up.  I remember it working before though so I just took his code and plopped it into a newer instance and it worked.  I passed it for super-review.

Ticket #42
It was to fix the infinite loop happening in nf().  The fix looked simple enough that it didn’t even need to be tested.  I passed it for super-review.

Ticket #60, 61, 62
Andor’s release and awesome demo(needs 3D capable browser, like Minefield) proved it’s worth.  I, admittedly, didn’t even see the need to use the processing.org/reference examples for a test.  I passed it for super-review.

Ticket #171, 188
The code was pretty straightforward using localStorage in the DOM.  I was a bit concerned about the tests slowing down my computer (as I could hear it struggling).  I brought this up to Corban and he said it was fine.  It was due to the strings being saved every time the canvas is redrawn (which was a lot).  I passed it for super-review.

Ticket #205
This was already pre-tested by me.  I used the tests that I wrote and plugged in sephr’s code.  It works well and is more efficient so I backed it and passed it for super-review.

Next release…

With 0.4 set, I am looking out for the next release.  Unfortunately, the code I checked in for 0.3 and that I got reviewed for 0.4 didn’t make the cut.  It was mainly due to my not testing and having a few bugs.  I’m currently working out the bugs and writing tests this weekend for it.  You can keep up with what the 3d squad will be releasing for 0.5 by clicking here.  Now that is a plan to integrate our work and make sure combining it goes smoothly.  Hopefully, it works.  I’ll let you know next week, if not sooner!

Continuing my journey in Open Source…

Just starting OSD700 and I’m a week behind already.  Luckily, the 0.4 release (which is out at the end of this week) involves more review than adding new functions.  We’ve also added some new members to the team… Tiago Moreira, who will be the project manager and release driver.  The other new member is Corban Brooks, who will act as another reviewer to help take the load off Al (aka F1LT3R).

Project Plan for OSD700

My project plan has already shifted.  I was initially going to try to tie up loose ends in my code and re-release my 0.3 code.  However, the group goal for 0.4 is to iron out previous code that may already be approved and put into the library.  So we’re starting a peer-review process and making the check-in process more efficient.  This will help future releases.  So, as far as the 0.4 release goes… there’s not supposed to be any really new code (which means I should postpone my changes until 0.5).  This is somewhat good because my future functions (or trying to take future functions) we’re looking a little bleak.  Anyway on to unveiling my plans:

Release 0.4 – Peer Review and Check-in working code (make sure PMatrix3D gets in)
Release 0.5 – Adjust camera functions to include PMatrix3D and more efficient in-library functions.
Release 0.6 – Pick up matrix functions that Ed Sin (MinyXO) left off with and make sure they get checked in.
Release 0.7 – Finalize any problems with the camera/matrix functions and finish beginCamera and endCamera.
Release 0.8 – Fix and bugs with beginCamera and endCamera.
Release 0.9 – bug fixing?
Release 1.0 – more bug fixing?