Max Did It
Coding
,Wed
Post the First Comment
Tagged

Polygon Outlines With Uniform Inset

I want users of my hardware text rendering library firetype to be able to render characters with outlines.

Sounds simple enough, right? Adding an outline to text is a matter of setting a simple value in all major graphic softwares. Since firetype is able to retrieve the shapes of characters from font files, it should not be a problem to add an offset to these and render the result.

Turns out that adding an outline to a simple polygon is not as straightforward as you might think. In fact, to have a robust method of creating polygon outlines means to implement a relatively complex algorithm that encompasses several steps.

Even seemingly minor details like how far each vertex has to be moved to create the outline can create problems. The solution, however, is pleasently elegant, as you will see below. I will cover the other aspects of the outline algorithm in the next posts.

Read more...

Coding
,Thu
Post the First Comment
Tagged

How To Properly Render an X-Ray Silhouette Effect in Away3D

Back in February, I published an article which described how the silhouette/X-ray effect works that is used in some games for concealed objects. In the first half of the article, I described the principle behind the effect, in the second part I described how to implement the effect in Away3D.

This is a follow-up to that article, introducing a more elegant, improved way to implement the effect in Away3D.

Rendered Silhouette (XRay) Effect in Away3D

The method described in the original article involved complicated geometric transformations and sharing the 3D context between several separate View3D objects.

The version shown in this article only requires a single class containing a few methods and a single View3D.

Read more...