Image for post
Image for post
The Giant’s Causeway in Northern Ireland features hexagonal basalt columns. Source: https://en.wikipedia.org/wiki/File:Causeway-code_poet-4.jpg

This tutorial explores how to make a grid of regular convex hexagons in Blender with Python, then how to turn that script into an add-on. An example render made with the add-on looks like so:


Unity, Processing, Godot, Blender, Three.js

Image for post
Image for post
A particle system emits capsules in Blender.

This tutorial explores how to generate a capsule through script in five 3D environments. Or rather, how to approximate a capsule with a mesh. We’ll look at two game engines, Godot and Unity; one modeling suite, Blender; one creative coding IDE, Processing; and one browser-based tool, Three.js. We leave it to others to judge which APIs are better or worse.

There should be no illusion that learning to make a capsule is in itself useful; however, understanding how to make one shape across APIs can lay the groundwork to create many more. …


This tutorial introduces Blender’s BMesh as a way to create and edit meshes in Blender through Python. The benefit of BMesh is that we have access to higher level operations than we would working with vertices and face indices; however, we avoid overhead incurred with bpy.ops, the functions called by Blender’s graphical user interface (GUI).

This is aimed at readers who already have already tried their hand at scripting with Blender: who know how to set up Blender to be code friendly, who know how to look up an unfamiliar function in the documentation (either for Python or for Blender)…


Image for post
Image for post

This tutorial introduces how to make patterns with complex numbers in Blender. It builds off of tutorials on creative coding in Blender and scripting Cycles nodes. For that reason, it assumes some prior acquaintance with Blender’s Python API and Open Shading Language (OSL).

In this tutorial, we’ll go over

  • the maths behind complex numbers;
  • how to define complex number operations with nodes, Python and OSL;
  • how to create 2D patterns (the Mobius transformation, Mandelbrot set, Julia set, Pickover stalks and tricorn).
  • how to create a 3D Mandelbulb.

Last, we’ll look briefly at how a fractal pattern can be mixed with…


Image for post
Image for post
A curve approximating various sine waves.

This tutorial introduces how to edit curves in Blender with Python scripting. In the following, we’ll look at how to

  1. render a curve;
  2. convert a curve to a mesh;
  3. distribute objects along a curve;
  4. adjust movement with F-curves;
  5. move objects along a curve;
  6. create a curve with multiple splines;
  7. influence modifiers and particle motion with a curve;
  8. work with curves and animation rigs.

Blender supports both Bézier curves and Non-uniform rational basis splines (NURBS), but we’ll work with the former only. For those who want more background on this curve, Takashi Wickes offers a history in An Ode to the…


This tutorial introduces moving virtual cameras for 2D and 3D Processing sketches. First it looks at strategies for wrapping screen elements, like the background, when the camera is fixed. After introducing shaders and working with multiple renderers, it creates a 2D camera. It then creates the 3D equivalent, looking at projections along the way. The tutorial concludes with a First-Person Shooter (FPS) camera with a dynamic background and heads-up display (HUD).

Processing is designed for quick prototyping and a friendly introduction to creative coding. As such, it needs to be customized to implement the above. …


Image for post
Image for post

This tutorial, a follow-up to Creative Coding in Blender, focuses on creating patterns on materials in Blender’s Cycles renderer. There are a few reasons why patterning can be challenging at first. Tutorials for OpenGL Shading Language (GLSL) abound, but the node-based visual programming in Blender has a slightly different toolset. While Open Shading Language provides an alternative, it has a few drawbacks:

  • OSL requires that a render be done on the CPU, not the GPU.
  • There’s a potential dependency, where .osl files may have to be tracked along with the .blend file.
  • Documentation is segmented — and inconsistent — between…


Image for post
Image for post

This tutorial explores how translation, rotation and scale — taken together under the umbrella term affine transformations — work in Processing (Java mode). An alternative to matrices, based on a quaternion, is then created to show how we can ease between ‘keyframes.’ To keep this tutorial from being any longer than it already is, the code gists to follow contain only highlights under discussion. Full code for the classes and functions can be found here.

This tutorial was written with Processing version 3.3.7 in the Processing IDE (as opposed to Eclipse, etc.). Since coding with multiple objects requires a learning…


Image for post
Image for post

This tutorial aims to encourage creative coders to consider Blender as a platform for creating 3D artworks. Blender can be daunting to learn, so this primer is written for those who’ve tried their hand at creative coding before, but wish to expand. We’ll write some Python scripts to animate geometry and conclude with Open Shading Language to add texture to those models.

This tutorial was written with Blender version 2.79.

Configuring Blender for Scripting

Unlike environments focused on creative coding, such as Processing, Blender is a swiss-army knife. Animators, sculptors and texture artists will configure Blender differently to suit their work. For any given…


This tutorial introduces how to rotate objects in 3D beyond Euler angles; to do this, it looks at the basics of matrices and quaternions. What follows is math heavy, so a robust artistic imagination will be valuable once we dig in.

Image for post
Image for post
A 3D shape easing between rotations.

The approach we use is that of an excavation. We’ll recreate functionality already implemented behind the scenes in Processing and risk statements of the obvious so as to make the implicit explicit. …

Jeremy Behreandt

Creative coder from Wisconsin, USA.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store