A stump triangulated by gluTess*
A stump triangulated by gluTess*
And with this, I totally rid myself of both gluTess and GEOS.
I’m tired of screwing with complicated clippers with dumb licenses.
Since the move to Clutter, I’ve been randomly patching rbclutter to support 1.2+ features. Thanks to bpeel for rbclutter to begin with, and with some advice on my (slow) quest to get it up to speed with Clutter proper.
There are still some minor hacks in there from my days of “just get it working” (implementing dup instead of initialize_copy, reusing VALUES without much care to the GObject refct, etc), but it mostly works, and has support for a few newer things that I’ve needed.
Spent two days trying to get a half-decent boolean polygon library working in Ruby. Ended up using the SWIG bindings to the PostGIS geos library, which are amazingly buggy. In this photo, you see two stumps, the one on the left is made of 7 or so paths, the one on the right, a single path.
My goal was to allow objects on the visual layer to have physical geometry, but the constraints of the geometry layer are lifted, as objects tend to be drawn as to look good, not have a low poly count. The algorithm here does a boolean union on graphical polys before generating a physics poly, so the left and right stumps have an identical wireframe.
This fix took two days, including a set of FFI bindings to GEOS, which were abandoned because GEOS has an amazingly crazy API. Moving on…
I’ve noticed I’m in this pattern of writing all this complicated code, getting it working, then finding a way of pushing it off by getting the same functionality from a library I’m already using. In this example, I’ve replaced my GeometryPen with Cairo’s cairo_copy_path_flat.
I was under the impression that the tolerance could not be set on curves, but cairo_set_tolerance is sitting right there, fully documented. For the most part, the functionality is the same, but Cairo by itself is a bit smarter than my solution regarding circles. My implementation converted them into arcs in an almost cool manner, but by the time they came out, they were sliced like pizzas in the physics engine, which wasn’t required, as it’s still a simple polygon. Cairo generates some nice stop-signs.
Also in the photo: misaligned parallax scrolling. On the long list of TODO.
Day 20: Clutter, Parallax Scrolling
No updates in a few days, but I was really busy converting the engine over to Clutter/rbclutter, and it was the best decision I’ve made. Once I knew I was about to have to get into texture slicing, I decided I needed some backup on this scene-graph stuff.
Clutter has a 2D scene graph over OpenGL, and seems to be performing than my hacked together layer system.
I’m to a point where screenshots aren’t really capturing what’s new: In this one, we have a parallax scrolling background. The pink rectangle is a sensor in the “markers” layer, rigged to the level-scripting system that already works.