GLSL 3D Fractals - Quaternion Julia Sets
Quaternion Julia sets extend the classic 2D Julia sets into 4D space using quaternion algebra, then project them back into 3D for visualization. The result is stunning organic, swirling forms with complex rotational symmetries that would be impossible in 2D.
Interactive Demo
Move your mouse to rotate the camera and control the Julia parameter. The fractal animates automatically, creating mesmerizing morphing patterns:
Mathematical Foundation
Quaternions
Quaternions extend complex numbers to 4D:
Where and , , .
Quaternion Multiplication
vec4 qmul(vec4 q1, vec4 q2) {
return vec4(
q1.x * q2.x - q1.y * q2.y - q1.z * q2.z - q1.w * q2.w,
q1.x * q2.y + q1.y * q2.x + q1.z * q2.w - q1.w * q2.z,
q1.x * q2.z - q1.y * q2.w + q1.z * q2.x + q1.w * q2.y,
q1.x * q2.w + q1.y * q2.z - q1.z * q2.y + q1.w * q2.x
);
}
Quaternion Julia Iteration
The Julia set iteration in quaternion space:
Where both and are quaternions. The quaternion square is computed using quaternion multiplication.
Distance Estimation
Similar to the Mandelbulb, we use:
Where $z'$ is the derivative of the iteration. For , the derivative is .
Visual Characteristics
Quaternion Julia sets exhibit:
- Rotational symmetry: Complex 3D rotational patterns
- Organic forms: Swirling, tentacle-like structures
- Parameter sensitivity: Small changes in
ccreate dramatically different shapes - 4D projection: The 3D slice reveals hidden 4D structure
Parameter Space
The Julia parameter c controls the shape:
- Real components (
c.x, c.y, c.z): Control the 3D structure - Imaginary component (
c.w): Adds 4D rotation, creating more complex forms - Magnitude: Larger
|c|creates more chaotic, fragmented structures
Applications
- Digital art: Stunning abstract visualizations
- Scientific visualization: Exploring 4D mathematical structures
- Game assets: Procedural alien environments
- Educational: Teaching quaternion algebra and 4D geometry
References
- "Quaternion Julia Sets" by John C. Hart et al.
- Quaternion Julia Sets on Wikipedia
- Inigo Quilez - Distance Estimation
Related Articles
- GLSL 3D Fractals - Mandelbulb - Related 3D Mandelbrot extension
- GLSL 3D Fractals Series Index - Return to series index