Another two weeks have passed! At some point every piece fell together and all arrow shader code became clear to me, which has resulted in all Glumpy arrows ported to Vispy! A few selected examples can be seen in the image below.
It's not perfect yet, the OpenGL shader tries to automatically calculate the orientation of the arrow head, but it is often slightly off. Also note that I've also added the new "inhibitor" arrow head. We've decided to document the principles behind this, and I used a few days to write a tutorial about it, which can be found here.
However, there's a big update coming to Vispy changing quite a lot about the visual and scene system, so it requires a few changes to the code before it can be merged.
The coming weeks I'll start thinking about the design of the network API!
Part of my Google Summer of Code project involves porting several arrow
heads from Glumpy to
Vispy. I also want to make a slight change to them:
the arrow heads in Glumpy include an arrow body, I want to remove that
to make sure you can put an arrow head on every type of line you want.
Making a change like that requires that you understand how those shapes
are drawn. And for someone without a background in computer graphics this took some thorough
investigation of the code and the techniques used. This article is aimed
at people like me: good enough programming skills and linear algebra
knowledge, but almost no former experience with OpenGL or computer
graphics in general.
Wow, we've already passed the first two weeks of the Google Summer of Code! So it's time for a little report on the current progress. I do have quite a lot of study assignments, so unfortunately I was not able to devote as much time to the GSoC as I planned to do, but there's is definitely some progress!
I've ported the code for drawing curved lines from Glumpy to Vispy. This was quite easy as the code written by Nicolas Rougier didn't have any exotic dependencies and I actually just copied the file and fixed some imports. I did write an example how to use this Bezier lines module, which can be found here.
This has been a more challenging assignment. Glumpy has several OpenGL shaders for drawing arrows. I want to port these arrows, but with a slight change: I only want to draw the arrow heads. In this way the user can draw any line he or she wants, and optionally include any arrow head, with automatic orientation of the head.
For one without a computer graphics background and without much OpenGL experience, some of this shader code looks like a lot of magic, but luckily there's one thing that sort of saves me: my linear algebra knowlegde. With a notebook besides my keyboard where you can write down the mathematical formulas, visualizing the vertices used, etc. its inner workings are slowy revealed. The current result can be seen in the picture below.
I'm not sure yet why the first arrow head is oriented in the wrong way, and the curved arrow heads are still a bit to big, but we're getting there! I'll write a separate blogpost in the coming weeks on the mathematical principles behind drawing these shapes.
So, let's revive this blog a little bit! I'm happy to announce that I've been accepted to the Google Summer of Code 2015! This time as student under the umbrella organisation of my favourite programming language, the Python Foundation!
I'll be working on Vispy, a relatively young scientific visualization library, which uses the GPU intensively to achieve high performance even when visualizing large datasets, or when you require real-time interactivity. Read on to see what I want to achieve this summer!