Wednesday, January 28, 2009

White Sky

English    Spanish

I put here some renders that I did some time ago and I have re-rendered recently. Simply they are simple geometric figures to test oclussions. The skydome is totaly white, as well as the reflectors and the luminarie. The result so it is gray. Originally these designs were backgrounds of a lost blog that I did long time ago. It can be work quite well as wallpapers.



Sunday, January 18, 2009

Truchet Tilings

English    Spanish

Today I'm going to show a set of renders that are related to Truchet Tesellations. In 1704 Sebastien Truchet thought about a system of teselate a plane using oriented triangles. A modification of this one allow us to generate labyrinthic motifs using curved lines. In 1989 Pickover shown that it was an elegant method to see patterns in pseudorandom numbers secuences.

Seeing the Pickover's motifs I thought that it should be a way to tesselate a sphere without producing singularities at the poles.

So, here they are the ingredients:
  • Take a geodesic sphere discretized in triangles more or less regular with similar size.
  • Define 5 triangular tiles.
  • For each triangle replace it with one of the 5 tiles in a random fashion or with a certain probability distribution.
Here I show the results:

It can be shown only a certain kind of tiles:
Type 1

Type 2

Type 3

Type 4

Type 5

Only two types:




Uniform proability distributions:


Distributions of non uniform probability for each type:






Finaly all the types:


Images without the inner sphere:

and with a inner point of light:

With other materials:




Planar projections with non-linear cameras:


Finally, with all those projections depends on a triangular mesh it's possible to make denser motifs or even with a certain meshes. Like in this case, the Stanford Bunny:

Saturday, January 17, 2009

Textos bilingües

English Spanish

This post is not related to computer graphics. I present a way to show posts in two languages. The mechanism is very simple and can be used in blogspot as I'm going to show. I haven't wasted too much time in finding over internet similar mechanisms. Due to the simplicity of this method I had prefered doing it by myself.

In order to achieve this javascript will be used. I expose the steps:

  • Modifying the template

  • Creation of the language links in the post

  • Definition of the language blocks in the post


Modifying the template
The template can be modified in Design options of blogger. It's possible to add this:

<script language='javascript' type='text/javascript'>
function showBlk_1 ()
{
var nodeObj = document.getElementById('blk_1')
nodeObj.style.display = 'inline';
var nodeObj = document.getElementById('blk_2')
nodeObj.style.display = 'none';
}
function showBlk_2 ()
{
var nodeObj = document.getElementById('blk_2')
nodeObj.style.display = 'inline';
var nodeObj = document.getElementById('blk_1')
nodeObj.style.display = 'none';
}
</script>

The code is simple. If showBlk_1 is invoked, the style of the block identified by blk_1 is changed to visible, and the one identified with blk_2 is set to invisible.
The other function does the oposite operation.

Creation of the language links in the post
Simply we define the tags 'span' o 'a' with a href targeting '#' and this is the important thing: An onclick function:
For example:

<a href='#'><span onclick="showBlk_1()">Spanish</span></a>
<a href='#'><span onclick="showBlk_2()">English</span></a>


Definition of the language blocks in the post
Finaly now the texts in the two languages are written. The text in the language associated to the block 1 (blk_1) will be inside in a div block identified with blk_1.
The texts in the other language will be inside the other block.
For example:

<div id="blk_1" style="display: inline;">Esto es un texto en idioma Español.</div>
<div id="blk_2" style="display: none;">This is an English text.</div>


One of the blocks has to be visible and the other ones invisibles so by default only one language will be shown.

Here, for clarity it has been added a return carriage to separate the divs but in the post the 'divs' shouldn't be separated. If not, the second language will appear with an extra line.


Conclusion
It has been shown a very easy way to generate posts in two langages. This model it's also easily scalable to manage schemes with multiple languages.