Saturday, September 21, 2013

GSoC Experiences(3)

This is the third article in the series of articles written on my GSoC experiences, describing some details  on project developments, which I couldn't report due to circumstances.

I will start where I left off. So, I was working on a GUI.
This is what I came up with!



Well Its just a basic GUI with some simple implementation features, i.e. play pause and controls reset.
But it was a good start, and seemed neat.

So after that I had to start working on Javascript class, Canvas class, which was going to handle all the visualization things.
I felt that I did not have enought knowledge on Javascript structure based on Prototypes, So I spent some time knowing about prototypes, and  how to work with them.

I was stuck in more than one places during Javascript source code development phases.
I was stuck with rendering the initial scene, the axes and the grid, and getting them altogether.

Another problem I encountered was with the dreaded "this" keyword in Javascripts.
The problem was that the "Play","Pause" buttons had there OnClick attrubute attached to this.startAnimation, where "this" represented the Canvas class, But the buttons seemed to take this as the default window property of the browser, and gave errors. It took me some time to figure it out and debug them all. What works is instead of using "this.startAnimation", I was supposed to use "Canvas.prototype.startAnimation", hence this is one of the places where prototypes were savior.

Except this, there were some other minor glitches with animations, But thankfully, they were all resolved, and In next and last article of this series of GSoC Experiences, I am going to write about the final outcome of the hardwork, a working example of PyDyViz.



No comments:

Post a Comment