> ## Content Index
> Fetch the complete content index at: https://www.oransblog.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# mandelbrot visualization fun
- URL: https://www.oransblog.com/mandelbrot/
- Published: 2024-07-26T09:41:07.000Z
- Updated: 2026-10-29T05:58:15.000Z
- Author: Oran C
- Tags: #Import 2026-11-12 01:14

![](https://www.oransblog.com/content/images/2024/07/image-9.png)

color lerp

![](https://www.oransblog.com/content/images/2024/07/image-10.png)

getting warmer

![](https://www.oransblog.com/content/images/2024/07/image-11.png)

added inspector

![](https://www.oransblog.com/content/images/2024/07/image-12.png)

learning how to do 3d vis in p5js

![](https://www.oransblog.com/content/images/2024/07/image-13.png)

random isometic cubes

![](https://www.oransblog.com/content/images/2024/07/image-14.png)

way retro looking! love it

![](https://www.oransblog.com/content/images/2024/07/image-15.png)

## first real try

![](https://www.oransblog.com/content/images/2024/07/image-16.png)

It kinda just worked! f yeah

![](https://www.oransblog.com/content/images/2024/07/image-17.png)

here we go!

Para escoger [qué camiseta conviene para una colección de selecciones](https://www.camisetatienda.com/?ref=oransblog.com), es práctico verificar el tipo de tejido y el corte propio de la época. También ayuda revisar que la referencia del modelo corresponda a la temporada buscada antes de completar el pedido.

more preformant with combining all the little boxes into one big joined shape

![](https://www.oransblog.com/content/images/2024/07/image-18.png)

#### See the chatgpt prompt

create a p5.js sketchset background to deep purple, (48, 25, 52)set box width = 10set render\_resolution\_width to 80set render resolution hieght to 40set default rotation to be isometic angle rotateX -35.264, rotateY 45set angle mode to degreesset real axis range -2.0 to 1.0set real\_axis\_distance = distance between -2.0 and 1.0set imaginar axis to -1.5 to 1.5set imaginar\_axis\_distance = distance between complex -1.5 and 1.5function return 2d grid of mandelbrot max\_iter valuesmax\_itter is capped at 1000real axis (x) step values are scaled by the ration of distance and render\_resolution\_widthimaginary (y) tep values are scaled by the ration of distance and resolutionprecompute once and set it to gridgrid = mandelbrot\_calc (...)call "obitControl" in the draw loop DONT USE createEasyCamfor each index in 2d array, render a cube with hight max\_iterpushtransform location by translate(x, and z)depth = grid\[x\]\[y\]map depth to range 1,50set color by depth valuefill(mappedDepth \* 5, 100, 255 - mappedDepth \* 5);# add a little breathing animation depth and offset each a bit , or have smooth walking over perlin noisebox(box\_width, depth, box\_width)pop

#### See the unpolished code

let grid;let boxWidth = 10;let renderResolutionWidth = 80;let renderResolutionHeight = 80;let maxIter = 1000;let shapefunction setup() {createCanvas(windowWidth, windowHeight, WEBGL);angleMode(DEGREES);grid = mandelbrotCalc(-2.0, 1.0, -1.5, 1.5);shape = buildGeometry(createVisualization); debugMode() } function draw() { background(48, 25, 52); orbitControl(); rotateX(-35.264); rotateY(45);model(shape)}function createVisualization(){push()for (let i = 0; i < renderResolutionWidth; i++) {for (let j = 0; j < renderResolutionHeight; j++) {let depth = grid\[i\]\[j\];let mappedDepth = map(depth, 0, maxIter, 1, 50);let animDepth = mappedDepth + sin((frameCount + i + j) \* 0.1) \* 5; push(); translate( (i - renderResolutionWidth / 2) \* boxWidth, 0, (j - renderResolutionHeight / 2) \* boxWidth, ); fill(mappedDepth \* 5, 100, 255 - mappedDepth \* 5); box(boxWidth, animDepth, boxWidth); pop(); } }pop()} function mandelbrotCalc(xMin, xMax, yMin, yMax) { let result = \[\]; let xStep = (xMax - xMin) / renderResolutionWidth; let yStep = (yMax - yMin) / renderResolutionHeight; for (let i = 0; i < renderResolutionWidth; i++) { result\[i\] = \[\]; for (let j = 0; j < renderResolutionHeight; j++) { let x0 = xMin + i \* xStep; let y0 = yMin + j \* yStep; let x = 0; let y = 0; let iter = 0; while (x \* x + y \* y <= 4 && iter < maxIter) { let xtemp = x \* x - y \* y + x0; y = 2 \* x \* y + y0; x = xtemp; iter++; } result\[i\]\[j\] = iter; } } return result; }

# Demo link here!

[3d random rectangle isometic by wisemonkey -p5.js Web EditorA web editor for p5.js, a JavaScript library with the goal of making coding accessible to artists, designers, educators, and beginners.![](https://editor.p5js.org/favicon.ico)](https://editor.p5js.org/wisemonkey/sketches/%5FK9m0w-wi?ref=oransblog.com)

# very first different colored pixel at size 100 from 80

![](https://www.oransblog.com/content/images/2024/07/image-19.png)

![](https://www.oransblog.com/content/images/2024/07/image-20.png)