Tutorials and Hairy Balls

Cube with applied material.

There are hundreds of tutorials for Blender. Maybe thousands. As you might expect they vary in quality from not-so-good to very good. One of the characteristics that they all seem to share is that they are fast! Some are far too fast, some are not too fast and I can keep up with them. What I’ve decided to do is watch a tutorial without making note of the techniques used and then go through it again stopping and starting to get a better idea of what is going on.

Another issue is that Blender is complex, as it needs to be to produce realistic 3-D images. That often means that there are usually several ways of achieving something, and a tutorial author might prefer one over another for some reason. Rarely does an author go into why he did something a particular way, and if he does, it can be incredibly useful.

Anyway, I’ve been looking into ‘materials’ and ‘textures’ recently. ‘Materials’ are the stuff that things are made of, like ‘metal’ or ‘marble’. Textures are, as someone said in a tutorial, descriptive of the material. For example a metal object may be rusty, or a marble object might be dirty.

Fabric ball
Fabric covered ball

There are hundreds of free materials and textures available for anyone to download. I’ve downloaded a few from Chocofur who provide a several useful packs of free materials for download. You can also purchase some impressive models from them.

Another source of useful materials are the tutorials. Sometimes a tutorial author will include the materials that he has used in his tutorial, to help those who have taken his tutorial, so that they can repeat the steps he took in his tutorial and learn that way.

Of course, a simple image downloaded from the Internet or a camera image can be used as a source of material and/or textures, but that means that the artist will need to do more work, which brings me to another point. When a texture is downloaded from the Internet, it is usually in the form of a “blend” file which has to be ‘appended’ to the model being created. (A “blend” file is the format in which Blender saves a file, whether it’s one of  your own creations or one from the Internet) When I downloaded my first materials, I didn’t know this, so I just used the images from the downloaded files. This produces results which are, basically, rubbish.

A downloaded texture usually contains several images, used for different purposes – as a colour map, a displacement map, or one of several other types of map. I use the word “map” loosely here. These are used in the “shader” in various ways. I’m not going to define “shader”, but loosely, it’s how the material/texture is applied.

A Hairy Ball
A hairy ball

What I didn’t realise when I started to look into materials, and textures and shaders was that it is fun to play around with them. A shader is a bunch of nodes linked together. Each node is a box with adjustable sliders and values in it, and you can play with them to your hearts content.

Here’s one of Chocofur’s shaders below. Note all the options that you can change! You can also add other nodes to modify the provided shader, and that where the fun begins! Of course, it helps if you know what the nodes do, but that doesn’t prevent experimentation of course.

 

 

Node map of Chocfur’s Solid Marble shader

OK, to end with I’m going to show you two of my images, created in the last week or two. They are renders of a cliff face. The first is my first attempt. I created a plane mesh and subdivided it with the fractal parameter set to non-zero. This has the effect of “crumpling” the surface a little. Then I added a pretty bland texture and rotated the plane so that it looked like a cliff.

Cliff version one
Cliff version one

There’s obvious problems with of course. It’s pretty meh! And the bands across it are distracting. Here’s the second attempt.

Cliff version two
Cliff version two

This one is the opposite of the first! It has a bolder material, and is considerably more crumpled. Back to the drawing board. Oh, and I’ve got to work on the lighting.

Please read my books. The paperback versions can be found Amazon, and the eBooks can be found there or at your favourite eBook store. Just search for my name, Cliff Pratt. I mainly write fantasy fiction.

Puzzles

Pieces of a puzzle
Pieces of a puzzle (Photo credit: Wikipedia)

I’ve been musing on the human liking for puzzles. I think that it is based on the need to understand the world that we live in and predict what might happen next. A caveman would see that day followed night which followed the day before, so he would conclude that night and day would continue to alternate.

It would become to him a natural thing, and in most cases that would be that, but in a few cases an Einstein of the caveman world might wonder about this sequence. He might conclude that some all powerful being causes day and night, possibly for the convenience of caveman kind, but if his mind worked a little differently he might consider the pattern was a natural one, and not a divinely created phenomenon.


Embed from Getty Images

Puzzling about these things is possibly what led to the evolution of the caveman into a human being. Those cavemen who had realised that the world appear to have an order would likely have a survival advantage over those who didn’t.

The human race has been working on the puzzle of the Universe from the earliest days of our existence. Solving a puzzle requires that you believe that there is a pattern and that you can work it out.


Embed from Getty Images

The Universal pattern may be ultimately beyond our reach, as it seems to me that, speaking philosophically, it might be impossible to fully understand everything about the Universe while we are inside it. It’s like trying to understand a room while in it. You may be able to know everything about the room by looking around and logically deducing things about it, but you can’t know how the room looks from the outside, where it is and even what its purpose is beyond just being a room.

Solving a puzzle usually involves creating order out of chaos. A good example is the Rubik’s Cube. To solve it, one has to cause the randomised colours to be manipulated so that each face has a single colour on it.

English: Rubik's Cube variations
English: Rubik’s Cube variations (Photo credit: Wikipedia)

A jigsaw puzzle is to start with is chaos made manifest. We apply energy and produce an ordered state over a fairly long time – we solve the jigsaw puzzle. After a brief period of admiration of our handiwork we dismantle the jigsaw puzzle in seconds. Unfortunately we don’t get the energy back again and that’s the nature of entropy/order.

Many puzzles are of this sort. In the card game patience (Klondike), the cards are shuffled and made random, and our job is to return order to the cards by moving them according to the rules. In the case of patience, we may not be able to, as it is possible that there is no legal way to access some of the cards. Only around 80% of of patience games are winnable.

Empire Patience Playing Cards, Box
Empire Patience Playing Cards, Box (Photo credit: Wikipedia)

Other games such as the Rubik’s Cube are always solvable, provided the “shuffling” is done legally. If the coloured stickers on a Rubik’s Cube are moved (an illegal “shuffle”) then the cube might not be solvable at all. A Rubik’s Cube expert can usually tell that this has been done almost instantly. Of course, switching two of the coloured stickers may by chance result in a configuration that matches a legal shuffle.

When scientists look at the Universe and propose theories about it, the process is much like the process of solving a jigsaw puzzle – you look at a piece of the puzzle and see if it resembles in some way other pieces. Then you look for a similar place to insert your piece. There may be some trial and error involved. Or you look at the shape of a gap in the puzzle and look for a piece that will fit into it. One such piece in the physics puzzle is called the Higgs Boson.

English: LHC tunnel near point 5. The last mag...
English: LHC tunnel near point 5. The last magnets before the cavern. (Photo credit: Wikipedia)

The shape is not the only consideration, as the colours and lines on the piece must match the colours and lines on the bit of the puzzle. In the same way, new theories in physics must match existing theories, or at least fit in with them.

Jigsaw puzzles are a good analogy for physics theories. Theories may be constructed in areas unrelated to any other theories, in a sort of theoretical island. Similarly a chunk of the jigsaw could be constructed separately from the rest, to be joined to the rest later. A theoretical island should eventually be joined to the rest of physics.


Embed from Getty Images

Of course any analogy will break down eventually, but the jigsaw puzzle analogy is a good one in that it mirrors many of the processes in physics. Physical theories can be modified to fit the experimental data, but you can’t modify the pieces of jigsaw to fit without spoiling the puzzle.

The best sorts of puzzles are the ones which give you the least amount of information that you need to solve the puzzle. With patience type games there is no real least amount of information, but in something like Sudoku puzzles the puzzle can be made more difficult by providing fewer clues in the grid. A particular set of clues may result in several possible solutions, if not enough clues are provided. This is generally considered to be a bad thing.

Solution in red for puzzle to the left
Solution in red for puzzle to the left (Photo credit: Wikipedia)

Some puzzles are logic puzzles, such as the ones where a traveller meet some people on the road who can only answer “yes” or “no”. The problem is for the traveller to ask them a question and deduce the answer from their terse replies. The people that he meets may lie or tell the truth or maybe alternate.

Scientists solving the puzzle of the Universe are very much like the traveller. They can question the results that they get, but like the people that the traveller meets, the results may say “yes” or “no” or be equivocal. Also, the puzzle that the scientists are solving  is a jigsaw puzzle without edges.

English: Example of a solution of a Hashiwokak...
English: Example of a solution of a Hashiwokakero logic puzzle. Deutsch: Beispiel einer Lösung eines Hashiwokakero Logikrätsels. (Photo credit: Wikipedia)

Everyone who has completed a jigsaw puzzle knows that the pieces can be confusing, especially when the colours in different areas appear similar. For scientists and mathematicians a piece of evidence or a theory may appear to be unrelated to another theory or piece of evidence, but often disparate areas of study may turn out to be linked together in unexpected ways. That’s part of the beauty of study in these fields.


Embed from Getty Images

 

Fractals

A Julia set, a fractal related to the Mandelbr...
A Julia set, a fractal related to the Mandelbrot set (Photo credit: Wikipedia)

Now and then I fire up one of those programs that displays a fractal on the screen. These programs use mathematical programs to display patterns on the screen. Basically the program picks the coordinates of a pixel on the screen and feeds the resulting numbers to the program. Out pop two more numbers. These are fed back to the program and the process is repeated.

There are three possible outcomes from this process.

Firstly, the situation could be reached where the numbers being input to the program also pop out of the program. Once this situation is reached it is said that the program has converged.

Convergent light beam passing through a square...
Convergent light beam passing through a square hole (Photo credit: Wikipedia)

Secondly, the numbers coming out of the program can increase rapidly and without bounds. the program can be said to be diverging.

Thirdly, the results of the calculation could meander around without ever diverging or converging.

English: The Markov chain for the drunkard's w...
English: The Markov chain for the drunkard’s walk (a type of random walk) on the real line starting at 0 with a range of two in both directions. (Photo credit: Wikipedia)

A point where the program converges can then be coloured white. Where it diverges, the point or pixel can be coloured black. A point where the program seems to neither converge nor diverge can then be coloured grey. A pattern will then appear in the three colours which is defined by the equation used.

Anyone who has seen fractals and fractal programs will realise that a three colour fractal is pretty boring as compared to other published fractal images. Indeed the process that I have described is pretty basic. A better image could be drawn by colouring points differently depending on how fast the program converges to a limit. This obviously requires a definition of what constitutes convergence to a limit.

Fractal Art
Fractal Art (Photo credit: Wikipedia)

Convergence is a tricky concept which I’m not going to go into, but to compute it to say in a computer program you have to take into account the errors and rounding introduced by the way that a computer works. In particular the computer has a largest number which it can physically hold, and a smallest number. Various mathematical techniques can be used to extend this, but the extra processing required means that the program slows down.

[Fractal]
[Fractal] (Photo credit: Wikipedia)
I’m not going to explain how this difficulty is circumvented, since I don’t know! However the fact is that the computer generated fractals are fascinating. Most will allow you to continually zoom in on a small area, revealing fantastic “landscapes” which demonstrate similar features at all the descending levels. Similar, but not the same.

fractal landscape
fractal landscape (Photo credit: Wikipedia)

The above far from rigorous description describes one type of fractal of which there are various sorts. Others are described on the Wikipedia page on the subject.

Another interesting fractal is created on the number line. Take a fixed part of the number line, say from 0 to 1, and divide it into three parts. Rub out the middle one third. This leaves two smaller lines, from 0 to 1/3 and from 2/3 to 1. Divide these lines into three parts and perform the same process. Soon, all that is left is practically nothing. This residue is known as the Cantor set, after the mathematician Georg Cantor.

English: A Cantor set Deutsch: Eine Cantor-Men...
English: A Cantor set Deutsch: Eine Cantor-Menge Svenska: Cantordamm i sju iterationer, en fraktal (Photo credit: Wikipedia)

This particular fractal can be generalised to two, three, or even higher dimensions. The two dimensional version is called the Sierpinski curve and the three dimensional version is called the Menger sponge.

One of the fractal curves that I was interested in was the Feigenbaum function. This fractal shows a “period doubling cascade” as shown in the first diagram in the above link. If you see some versions of this diagram the doubling points (from which the constant is determined) often look sharply defined.

English: A very old ficus tree in São Paulo, B...
English: A very old ficus tree in São Paulo, Brasil. Deutsch: Ein sehr alter Feigenbaum in São Paulo, Brasilien. Português do Brasil: Uma figueira muito antiga nas ruas de São Paulo, Brasil. (Photo credit: Wikipedia)

I was surprised the doubling points were not in fact sharply defined. You can see what I mean if you look closely at the first doubling point in the Wolfram Mathworld link above. Nevertheless, the doubling constant is a real constant.

English: Bifurcation diagram Česky: Bifurkační...
English: Bifurcation diagram Česky: Bifurkační diagram Polski: Zbieżność bifurkacji (Photo credit: Wikipedia)

Another sort of fractal produces tree and other diagrams that look, well, natural. A few simple rules, a few iterations and the computer draws a realistic looking skeleton tree. A few tweaks to the program and a different sort of tree is drawn. The trees are so realistic looking that it seems reasonable to conclude that there is some similarity between the underlying biological process and the underlying mathematical process. That is the biological tree is the result of an iterative process, like the mathematical trees.

Русский: Ещё одно фрактальное дерево. Фракталь...
Русский: Ещё одно фрактальное дерево. Фрактальное дерево. (Photo credit: Wikipedia)

I’ve mentioned natural objects, trees, which show fractal characteristics. Many other natural objects show such characteristics, the typical example which is usually given is that of the coastline of a country. On a large scale the coastline of a country is usually pretty convoluted, but if one zooms in the art of the coastline that one zooms in on stays pretty much as convoluted as the large scale view.

Mandelbrot fractal. Rendered as an island with...
Mandelbrot fractal. Rendered as an island with Terragen, a fractal-based landscape generator. (Photo credit: Wikipedia)

This process can be repeated right down to the point where one can see the waves. If you can imagine the waves to be frozen, then one can take the process even further, but at some point the individual water molecules become visible and the process (apparently) reaches an end.

If you want a three dimensional example, clouds, at least clouds of the same type, probably fit the bill. Basically what makes the clouds fractal is the fact that one cannot easily tell the size of a cloud if one is simple given a photograph of a cloud. It could be a huge cloud seen from a distance or a smaller cloud seen close up. Of course if one gets too close to a cloud it becomes hazy, indistinct, so one can use those clues to guess the size of a cloud.

Fractals were popularised by the mathematician Benoit Mandlebrot, who wrote about and studied the so-called Mandlebrot set, wrote about it in his book, “The Fractal Geometry of Nature”.  I’ve read this fascinating book.

English: Topological model of Mandelbrot set( ...
English: Topological model of Mandelbrot set( reflects the structure of the object ) Polski: Topologiczny model zbioru Mandelbrota ( pokazuje strukturę obiektu) (Photo credit: Wikipedia)

While I was searching for links to the Mandlebrot Set I came across the diagram which shows the correspondence of the period doubling cascade mentioned above and the Mandlebrot set. This correspondence, which I did not know about before, demonstrates the interlinked nature of fractals, and how simple mathematics can often have hidden depths. Almost always has hidden depths.

English: Paths of correspondence between scien...
English: Paths of correspondence between scientists (Photo credit: Wikipedia)