It seems to me like for some liberals not all people are born equal after all.

You might expect that while the conservatives are still stuck in the concern for color, liberals would have opened their minds and hearts to a more globally aware attitude by now. However, it sometimes seems to me that for some liberals the matter is not whether the people are of color or not anymore, but from _where_ in the world the people of color are. Like if liberal ideals only applied in their own national backyard, and all affairs beyond the fence of their country simply were not of their concern. Especially if the country is a country of brown people, indeed.

Very well done, short sighted liberals.

Here goes another mathematical image or formulanimation around sea life. And again, just as like with the fish, I had to compromise detail for compatibility. But there it is, a simple mathematical dolphin with a simple mathematical animation galloping an equally mathematical sea.

The interesting bit of this image is the way the water splashes are made. Given that the whole image is a volume and hence an implicit shape, and that the animation is stateless and also an implicit function of time, there’s no way I can use physics simulation for the water animation nor a cheap way to use sprites or particles for the water splashes. Instead, the water surface function evaluates the dolphins volumetric definition and computes the closest distance to it. Then, the water isosurface pushes itself upwards by that distance such that the water connects more or less naturally with the dolphin. This distortion is driven by the same trigonometric/harmonic rhythm that drives the jumping cycle of the dolphin, so that it only happens in the ascending segment for the back part of the tail and for the descending segment in the front.

The swimming animation is a regular cosine function, and so is the jumping as well just with a frequency one fifth of the swimming frequency (but bigger amplitude of course). The final animation is an interpolation between the two, such that both swimming and jumping occur.

The raltime version, with code/maths open for you to explore, here:

Speaking of xmas balls and maths, when performing the intersection of a ray (or origin ro and normalized direction rd) with a sphere (or radius sr and position sc) I see people doing this all the time:

float iSphere( in vec3 sc, in float sr, in vec3 ro, in vec3 rd )
    vec3 oc = ro - sc;
    float b = 2.0 * dot(rd, oc);
    float c = dot(oc, oc) - sr*sr;
    float t = b*b - 4.0*a*c;
    if( t > 0.0)
        t = (-b - sqrt(t)) / 2.0;
    return t;

Meaning they systematically forget to simplify the expression and destroy all the 2.0 and 4.0 coefficients, which cancel each other. Please, use this:

float iSphere( in vec3 sc, in float sr, in vec3 ro, in vec3 rd )
    vec3 oc = ro - sc;
    float b = dot(rd, oc);
    float c = dot(oc, oc) - sr*sr;
    float t = b*b - c;
    if( t > 0.0) 
        t = -b - sqrt(t);
    return t;

Not that the performance will change a lot, but do it for the karma?

I have had the xmas tree in my living room, with its shinny balls and lights on and everything, for a year now. I have switched it on almost every day of 2013.

However, when everybody else unpacks and installs their xmas tree this week, I packed mine and gave it back to its real owner, from who I borrowed it all this time. I’ll celebrate xmas of course, I love it, but I enjoyed a lot celebrating January, February, March, and all the other months till December as well.

One formula that I use a lot for create shapes such as tree leaves, petals, fish (see a few posts below), dolphins, mushrooms, and many others,

is the following:

which I extracted by generalizing the parabola 4·x·(1-x). It works in the domain [0..1], which is convenient because then one can easily stretch or compress the whole shape by a simple multiplication. It’s equally useful to normalize its range such that the returned values are always in the [0..1] interval. For that, one needs to look at its derivative

and extract the value of x at witch it becomes zero (besides the trivial solutions x=0 and x=1), and then make sure k is such that the function reaches 1 at that point. In other words, x=a/(a+b) and

america never stops surprising me with surreal (and embarrassing to its other first-world colleague countries) lunatic idiosyncrasies.

i just learned that dildos are illegal in some states of the US.

no . kidding . this is real. i repeat – it . is . real

instant demotion to freedomless/fundamentalistic nation for this one. seriously. what the fuck?

i’m sorry i’m this harsh, but there are some basics and important principles that i don’t tolerate seeing broken in nations that claim to be free

there is the berry.

and also the blueberry, the blackberry, the raspberry, the strawberry and the cranberry.

and then there is the dingleberry.

i love it. we have a funny word for “dingleberry” in spanish as well – we call it “tarzanillo”, or “little Tarzan” if translated, for obvious reasons. no kidding.

de alguna manera relacionado con la entrada anterior:

it’s tuesday morning in the city, and as such, there’s live all around us. mornings like this you can see some people rushing to work with a cup of coffee in their hands down the escalators, just like in the hollywood movies.

today it’s one of those days, and for some reason i am in such an escalator with a pile of people in line. and unfortunately for those rushing to work, there’s a guy in front of us blocking the escalator. when the sound of the train announces its immediate arrival, the people in the line gets tense. they are certainly going to miss their train unless the man blocking the escalator starts walking down it rather than keeping still staring at the walls. people try to move down the escalator but struggle to pass by him. a couple of them will make it, but for the most part all these people will miss their train. and we all know it.

and so, given the amount of concentrated hate directed straight at this man at this very moment, if there ever was any possibility telepathy would exist, some sort of awareness or feeling of discomfort or itchiness or something should awake in this man right now. however there he is, happy, absorbed, unaware, living his day and life not knowing he’s been furiously hated.

How ironic (and sad) it felt this unfortunate precipitation-free year when they pointed at those californian mountains from the car and said “look, that’s the Sierra Nevada range” and they barely had any snow.

Ie, “Sierra Nevada” literally means “Mountain Range Covered by Snow” in Spanish

I wonder how many californians know that

Fishy fishy fishy. This time I had a small argument with the web browser. Because I wanted more from it, but it wouldn’t give it to me. Very frustrating, I wanted more instructions, to implement more maths, more sculpting, or in other words, more detail. Detail in the fish, in its movement, in its texture and colors. But the browser would crash on me every single time. So I had to give up, and simplify my code, my formulas, my shapes, or in other words, my painting. Yet, here it is, a basic swimming mathematical fish.

The body is a chain of 7 line segments thickened with a quadratic shape for the body and a rational for the tail. Colors are simple orientation and position based color patterns, and movement is a cosine for the tail and a linear + noise (cubic polynomials) for the positioning. The seabed simple combination of noise textures, and the water surface, a plane. It sort of works if you blur your eyes, I think!

The raltime version, with code/maths open for you to explore, here:

it’s that time of the year when americans start thinking of their “new year’s resolutions”. in my case, for my 2014′s resolutions, i can simply recycle those of 2013, because this last year i failed at all of them…!

When in the first security gate at the airport when they take your ID and ask you to say your first and last name, what if, just for fun, you pretend you doubt…? Has anybody tried it?

I know it’s dangerous, and irresponsible, and all… But if I’m skiing and I see a beautiful corridor between the cliffs down the mountains with some minimum amount of snow, when the warning sign says “Closed” at its top all I can read is “Go!”

it’s still a month for the christmas festivities. but the city, packed with winter motives and lots glowing lights, is already ready for them. and so is my bike as well of course.

well, she’s ready the whole year, but these days she matches the setting better than usual

the wooden floor, the white windows to the street, the barre, the full size mirrors, the unique smell of perspiration, and of course, the music system playing a CD by Lisa Harris…

no matter were in the world you are, such a ballet studio feels always like a magical, timeless, and a familiar space

i remember when i moved here, a mere 4 years ago, and i went to a Japanese restaurant for the first time in my life. it was such a big thing to me, so new, so strange, so different

Sometimes I like doing variations of the same (technical) idea.

In this case, I reused the technique from last mathimage, the procedural 2D regular grid acceleration structure, in order to create an infinte field of randomly sized spheres and cylinders that move and glow. There are quite a few tricks in this one. For example, the ambient occlusion is a combination of procedurally painted occlusion, and read analytical sphere occlusion (as in this article. Because of that, and because I don’t use shadow rays, I can render shadowing very, very quickly. Also, the effect of the ligthting is local to the grid cell the pixel belongs to and its immediate neighbors. So, in the end, the rendering is fast enough that I can afford some brute force depth-of-field and motion-blur.

Artistically, there’s not much to say. I improvised this in a one hour session (plus one extra for fine tuning details) in a live coding session that started with no target and steered randomly as I progressed. I called these things “lanterns” because of their vague resemblance.

As usual, feel free to click “play” to see it moving realtime in your browser, and then in the title in order to see the code/maths.

… when you are an airplane crew member and before taking off you have to go row by row checking for unfasten seatbelts, meaning, looking at the vicinity if not the exactly the center of the passenger’s packages. no wonder they overlook so many unfasten seatbelts. just saying.

americans have something called “the zombie apocalypse”, that i never heard about before landing here. it’s one more of those things they have, like “the big foot”, the UFOs, God, Elvis and the nuclear holocaust.

so yes, i recently learnt what it is. and also recently, i think i found where they should start preventively looking and keeping an eye for it – in one of these laundry shops at the Tenderloin, between Geary and O’Farrel (a few blocks away from where I live):