particle-based viscoelastic fluid simulation
marcus • April 11th, 2008
amazing video by a clever canadian who has coded up a fluid simulation using particles, similar to what i’m currently working on in p5 – only that his one seems to be working ;-)
amazing video by a clever canadian who has coded up a fluid simulation using particles, similar to what i’m currently working on in p5 – only that his one seems to be working ;-)
hell, yeah!
– while working on the liquids code i realized that i need LOTS more particles to generate the level of detail i found in the analog photographs i did before. so after a few days of reading hundreds of opengl tutorials, research papers, game developers articles and 20+ p5 tests i'm finally getting closer to writing a particle system that can simulate 65k - 262k particles in real-time at 60+ fps. on my laptop (!), not a specialized über-workstation – in case you wonder.
that's a drastic increase over my previous java based system that could realistically do about 2k particles (10k was pushing it - ran at about 14 fps).
ill post some details on the new system soon, when its ready ...
Dynamic 3D Voronoi Demo from Moniker

The german sculptor Ulrich Rückriem, well known for geometrically divided and rearranged blocks of stone, now shows a series of conceptual drawings in a small exhibit at Museum Ludwig in Cologne. The black and white wall drawing and prints are based on a grid of 7×7=49 crosspoints.
7 points are selected and connected by straight lines which touch each point only one time and then get back to their origin. This produces a variety of acute-angled geometrical drawings.
The aesthetic system is based on what is known as a standoff situation in checkers game: Eight pieces stand on positions on the game board from where none of them can beat one another, neither on horizontal or vertical lines nor on diagonals.
image credit: Ulrich Rückriem, Ikarus, 2007 Copyright Ulrich Rückriem
how to do a slerp with angles?
that caused me some headache this morning. however, the solution is blatantly simple.
» example sketch
1 2 3 4 5 6 7 8 9 10 |
float angleSlerp(float cur, float to, float delta)
{
if(cur < -HALF_PI && to > HALF_PI) {
cur += TWO_PI;
} else if(cur > HALF_PI && to < -HALF_PI) {
cur -= TWO_PI;
}
return cur * (1-delta) + to*delta;
} |

nice geometric illustration work by icelandic design student siggi eggertsson
by Berlin based designer Andreas Nicolas Fischer
Source: jeffreydocherty.com

39 quasi-scientific paintings and drawings. Musing on the meaning of life, surrounding a twelve foot high black column filled with whirling computers. A hexagonal structure, The Thinker emits an electronic hum generated by the bank of computers inside. The computers are set to operate for 33,000 years with an LED display counting the seconds up to 76.5 years (the average human lifespan).
Tyson said it was his take on sculptor Rodin’s famous piece, The Thinker.

“The Thinker is a twelve foot high black column that houses a series of computers inside it, running an artificial life programme which has been programmed in such a way that it evolves. There is no physical manifestation of the fact that it is thinking, and I’m fascinated by the idea that when you come across it you have a thing that is thinking but which is impenetrable – that you can’t get within its skin. Once the thing sets off, I can predict that it’s thinking for about half an hour but after that I’ve got no idea – so I’m as much in the dark as everyone else as to what it’s actually thinking about.”
It is part of a series entitled “The Seven Wonders of the World”.
“That is a series of works that relate to things I find wonderous. I wanted to make works that were not illustrative of some scientific or philosophical theory but embodied it – were in fact the actual theory made manifest. The Thinker really thinks, and is thought. The fact that human beings have reached a stage where they can find a mathematical methodology for creating thought itself, and that we can comprehend our own existence, are some of the things I am trying to manifest in this work. It also relates to this idea that we can never actually prove what the internal dialogue of another human being actually is. It’s about the way in which everybody’s universe is impenetrable, and the way everyone who thinks has their own separate universe.”
Source: fineart.ac.uk
by kouhei_otsuki
chao, by Satoshi Aizawa


libCollada now does colors!
the library is getting nearer to being actually useful. it now creates new collada materials and effects for you as needed without writing a line of extra code.
» project pagefinally i found some time to finish a first release of my collada library for processing today.
it’s still quite basic and only exports triangles without any material information.
however there have been major refactorings under the hood that will allow to add new features much easier.
it might output garbage when you try to do something clever but give it a go
- your comments & critics are appreciated!
clean & naked
libCollada allows you to easily export 3D geometry and material data in the COLLADA 1.4.1 format from your processing applications. Although processing’s drawing methods and COLLADA’s scenegraph based, more complex 3D description format, do not match directly – the library attempts to do a reasonable conversion, requiring no extra API to learn.
now creates materials & effects generated from standard p5 drawing commands
» collada-0.2.zip
first public release with examples and packaged for p5
» collada-0.1.zip
a first rather rough version that can export basic geometry data.
svn export http://svn.infostuka.org/rep/libCollada/trunk/ |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import processing.opengl.*;
import infostuka.collada.p5.*;
void setup() {
size(400, 400, OPENGL);
}
void keyPressed() {
if (key == ' ') {
record = true;
}
}
void draw ()
{
if (record) {
beginRecord(P5ColladaExport.DAE, "output.dae");
}
// ... your drawing operations here ...
if (record) {
endRecord();
record = false;
}
}
|

Copyright © Marcus Wendt 2007
This library is licensed under the GNU LGPL

Arche de la Défense, Paris

Dali “crucifixion”

“Ipercubo” by Attilio Pierelli
And of course the Timetraveler
Eine kompakte Einführung in die Geometrie des Hyperwürfels.
“Der n-dimensionale Hyperwürfel” von Hans Walser, Mathematisches Institut Basel
For the most part, vector operations in four space are simple extensions of their three-space counterparts. For example, computing the addition of two four-vectors is a matter of forming a resultant vector whose components are the sum of the pairwise coordinates of the two operand vectors. In the same fashion, subtraction, scaling, and dot-products are all simple extensions of their more common three-vector counterparts.
In addition, operations between four-space points and vectors are also simple extensions of the more common three-space points and vectors. For example, computing the four-vector difference of four-space points is a simple matter of subtracting pairwise coordinates of the two points to yield the four coordinates of the resulting four-vector.
For completeness, the equations of the more common four-space vector operations follow. In these equations, U = <U0, U1, U2, U3> and V = <V0, V1, V2, V3> are two source four-vectors and k is a scalar value:
U + V = <U0 + V0, U1 + V1, U2 + V2, U3 + V3>
U - V = <U0 - V0, U1 - V1, U2 - V2, U3 - V3>
kV = <kU0, kU1, kU2, kU3>
U·V = U0V0 + U1V1 + U2V2 + U3V3
The main vector operation that does not extend trivially to four-space is the cross product. A three-dimensional space is spanned by three basis vectors, so the cross-product in three-space computes an orthogonal three-vector from two linearly independent three-vectors. Hence, the three-space cross product is a binary operation.
In N-space, the resulting vector must be orthogonal to the remaining N-1 basis vectors. Since a four-dimensional space requires four basis vectors, the four-space cross product requires three linearly independent four-vectors to determine the remaining orthogonal vector. Hence, the four-space cross product is a trinary operation; it requires three operand vectors and yields a single resultant vector. In the remainder of this paper, the four-dimensional cross product will be represented in the form X4(U,V,W).
To find the equation of the four-dimensional cross product, we must first establish criteria of the cross product. These are as follows:
It turns out that a somewhat simple-minded approach to computing the four-dimensional cross product is the correct one. To motivate this idea, we first consider the three-dimensional cross product. The 3D cross product can be thought of as the determinant of a 3x3 matrix whose entries are as follows:
+- -+
| i j k |
X3(U,V) = | U0 U1 U2 |
| V0 V1 V2 |
+- -+
where U and V are the operand vectors, and i, j & k represent the unit components of the resultant vector. The determinant of this matrix is
i (U1V2 - U2V1) - j (U0V2 - U2V0) + k (U0V1 - U1V0)
which is the three-dimensional cross product. Using this idea, we'll form the analogous 4x4 matrix, and see if it meets the four cross product properties listed above:
[2.1a]
+- -+
| i j k l |
X4(U,V,W) = | U0 U1 U2 U3 |
| V0 V1 V2 V3 |
| W0 W1 W2 W3 |
+- -+
The determinant of this matrix is
[2.1b]
|U1 U2 U3| |U0 U2 U3| |U0 U1 U3| |U0 U1 U2|
i|V1 V2 V3| - j|V0 V2 V3| + k|V0 V1 V3| - l|V0 V1 V2|
|W1 W2 W3| |W0 W2 W3| |W0 W1 W3| |W0 W1 W2|
If the operand vectors are linearly dependent, then the vector rows of the 4x4 matrix will be linearly dependent, and the determinant of this matrix will be zero. This satisfies the first condition. The third condition is also satisfied, since a scalar multiple of one of the vectors yields a scalar multiple of one of the rows of the 4x4 matrix. This results in a determinant that is scaled by that factor, so condition three is also met.
The fourth condition falls out as a property of determinants, i.e. when two rows of a determinant matrix are interchanged, only the sign of the determinant changes. Hence, the fourth condition is also met.
The second condition is proven by calculating the dot product of the resultant vector with each of the operand vectors. These dot products will be zero if and only if the resultant vector is orthogonal to each of the operand vectors.
The dot product of the resultant vector X4(U,V,W) with the operand vector U is the following (refer to equation [2.1b]):
U·X4(U,V,W) =
|U1 U2 U3| |U0 U2 U3| |U0 U1 U3| |U0 U1 U2|
U0|V1 V2 V3| - U1|V0 V2 V3| + U2|V0 V1 V3| - U3|V0 V1 V2|
|W1 W2 W3| |W0 W2 W3| |W0 W1 W3| |W0 W1 W2|
This dot product can be rewritten as the determinant
| U0 U1 U2 U3 |
| U0 U1 U2 U3 |
| V0 V1 V2 V3 |
| W0 W1 W2 W3 |,
which is zero, since the first two rows are identical. Hence, the resultant vector X4(U,V,W) is orthogonal to the operand vector U. In the same way, the dot products of V·X4(U,V,W) and W·X4(U,V,W) are given by the determinants
| V0 V1 V2 V3 | | W0 W1 W2 W3 |
| U0 U1 U2 U3 | | U0 U1 U2 U3 |
| V0 V1 V2 V3 | and | V0 V1 V2 V3 |
| W0 W1 W2 W3 | | W0 W1 W2 W3 |,
which are each zero.
Therefore, the second condition is also met, and equation [2.1a] meets all four of the criteria for the four-dimensional cross product.
Since the calculation of the four-dimensional cross product involves 2x2 determinants that are used more than once, it is best to store these values rather than re-calculate them. The following algorithm uses this idea.
// Cross4 computes the four-dimensional cross product of the three vectors
// U, V and W, in that order. It returns the resulting four-vector.
Vector4 *Cross4 (Vector4 *result, Vector4 U, Vector4 V, Vector4 W)
{
double A, B, C, D, E, F; // Intermediate Values
// Calculate intermediate values.
A = (V[0] * W[1]) - (V[1] * W[0]);
B = (V[0] * W[2]) - (V[2] * W[0]);
C = (V[0] * W[3]) - (V[3] * W[0]);
D = (V[1] * W[2]) - (V[2] * W[1]);
E = (V[1] * W[3]) - (V[3] * W[1]);
F = (V[2] * W[3]) - (V[3] * W[2]);
// Calculate the result-vector components.
*result[0] = (U[1] * F) - (U[2] * E) + (U[3] * D);
*result[1] = - (U[0] * F) + (U[2] * C) - (U[3] * B);
*result[2] = (U[0] * E) - (U[1] * C) + (U[3] * A);
*result[3] = - (U[0] * D) + (U[1] * B) - (U[2] * A);
return result;
}
Source: Four-Space visualization of 4D Objects