Hi @Shakes999!
This commonly happens when the pixel map you have loaded is for a different number of dimensions than the pattern is written for. If you have a 8x8x8 cube, you probably have a 3D map loaded - each pixel provides an X, Y, and Z coordinate. This Blinky Eyes 2D pattern was only written with a render2d() function, meaning it was designed for 2D flat displays.
Let’s see what we can do to project your 3D cube down into 2D space.
The simplest is probably to ignore one dimension entirely. I expect we’ll see the pattern on two of the 6 sides. To see it better, I’ve configured @GeekMomProjects’s wonderfully documented code to only show 1 eye.
var neyes = 1 // Show 1 or 2 eyes on the display
Now, let’s just try ignoring Z. To do this, I’ll provide a 3D renderer that only passes through X and Y.
// Add this outside other functions. I like it right above render2D().
export function render3D(index, x, y, z) {
render2D(index, x, y)
}
Awesome, “looking” good. (I hate myself, couldn’t resist).
You can pass a different subset of the dimensions to target other sides, or filter out one of the two sides:
export function render3D(index, x, y, z) {
if (z < .5) {
render2D(index, x, y)
} else {
rgb(0, 0, 0)
}
}
Rendering it on all 6 sides is a bit trickier. If that’s what you’re after, take a stab at it yourself and maybe come back and ask for some more help if you get stuck!