Transforms in generativepy
Martin McBride, 2022-01-08
Tags generativepy tutorial user space device space
Categories generativepy generativepy tutorial
Whenever you draw a Shape in generativepy, its size an position are specified in user space.
By default, user space maps directly onto device space, where one unit corresponds to 1 pixel in the generated image. However, we can change that mapping by applying scaling, rotation and other transformations. This means that an object specifies in user space will appear transformed in the final image. That avoids the need to perform any calculations in your drawing code.
This section covers: