Curved lines in 3D context!
June 7, 2010 2 Comments
0.9.3 code freeze has come and gone. Well, it’s not really a code freeze; more of the fact that the main PJS development team will be looking at other projects and sub-projects for a couple of weeks in the summer. So, the development of PJS will be a little slower over the next month or so. For 0.9.3, we pushed out as much working code as possible and moved the rest that we deemed unimportant enough before this freeze. There are still a few major functions that we have to get to and probably will be taken care of before 1.0 is released. Anyway, I just wanted to give you this brief update but what I really wanted to talk about are the bezier and curve functions.
These primitives are mainly used in 2D sketches for PJS; only because 3D didn’t support them yet. Now, we can get sketches like the following working in browsers:
(Note: WebGL enabled Browser needed)
That demo is a little slow and needs major optimizations on our part. Also, there are still known bugs that we are looking to get fixed at a later date. Trying to fill curves or beziers right now does not work very well, so I would suggest not doing it (if anyone can provide information on this subject, it’ll make for a quicker fix). Despite fills not working in curved lines, I was able to get it working (using a workaround) on 3D ellipses. However, it does come with it’s own flaw where in pixels are fighting for space. I, already, have a working idea on how to fix that. It involves dynamically setting the polygon offset on each new created object to be 1 pixel higher than the previous one in those coordinates. It sounds simple to explain but I have a feeling I will run into some expected and unexpected problems. We’ll see. Before I get to these new bugs though, I’m going to fix PGraphics slowly.