Counting shapes
Believe it or not, but this week’s Zdog graphic started out with the pixelated sprite for a promising mascot.
But just how can you paint a 2D picture in pseudo-3D? Well, in increments. And don’t worry, you won’t have to count too many copies before finding a satisfying answer.
How can you draw the sprite with SVG? I explored a few options in a past article, and ultimately found a solution with <path> elements. Paths with a stroke and a series of horizontal rules, marking the figure pixel by neighboring pixel. This is exactly how the first copy of the mascot is rendered.
But what is a pixel if not a square? You need the coordinates, the dimensions for each adjacent segment, but once you wrangle the string for the d attribute and obtain the values, you find a second way to paint a pretty picture. With <rect> elements instead.
And you might already see the way forward. Why stop with a 2D square where you can have a pseudo-3D box? Since you went through the hassle of finding the values for the rectangles, you already have the coordinates and the dimensions. What you then need is to add depth.
The result? Seemingly, the same exact mascot, only with the markup produced by Zdog. The benefit? With the library, it takes very little to explore the axes, and entertain different perspectives.
"Zdog Monday", a series of gorgeous pseudo-3D graphics built with Zdog in one day of the week.
There is a collection on CodePen, but if you want some context, and a few twists, I took care to write about each single piece.
- Beauty sleep
- Counting shapes
- Step through frames
- Spinning change
- One out of six
- Child's play
- Memory pop
- ZZ Anne
- Just keep spinning
- Advent of shapes
- Joystick drift
- Canard sans souci
- Brilliant idea
- Lighten up
- Guiding star
- Small whimsy
- Double axis
- Neigh we go round
- Having a ball
- Powerful mix
- Assembly code
- When lightning strikes
- Loopty loops
- Season's rewards
- Cherry-pick
- Trail blazer
- Hatch-a-doodle-doo
- Bubble up
- Think you can