Re: JSUI-MGraphics patch-a-day


Forums > Javascript > JSUI-MGraphics patch-a-day
Nov 21 2011 | 12:56 am

Here is the patch for November 20, 2011:

So digging into cairographics site, I ran across some information about dealing with the distortion of a warped transform matrix. In this example, I use the save() and restore() functions to reset the transformation before the stroke() call is made, thereby making the lines work better.

With the toggle box in the patch unchecked, it works identically to yesterday’s patch. If you turn on the toggle, though, the drawing routine is changed so that stroke() is not called until we restore the transform to its normal state.

The save() and restore() functions are perfect for this sort of application: a situation where you alter the environment considerably, but don’t want to pay a penalty in graphic output quality. I hope this makes sense, but the (somewhat subtle) visible end result should speak for itself.

Enjoy!

Subscribe to the Cycling ’74 Weekly Newsletter

Let us tell you about notable Max projects, obscure facts, and creative media artists of all kinds.

* indicates required