Sunday, April 02, 2006

Living in Virtual Space

This time round I will attempt to open up a whole new world to you.
A world known as Virtual Space.

As I mentioned in a previous weblog entry, Machinima is filming in Virtual Space (see Machinima).

To find out what Virtual Space is we will be travelling there, or actually creating it ourselves!

To do so I have downloaded a software package called Art of Illusion.


Art of Illusion - 3D modelling, animating and rendering software

= free download and installation, Windows and Mac compatible =

After installation, the first thing I have done is create a shape on the FRONT view of the canvas (shown in grey).


Grey shape in FRONT view of the canvas

Notice that in the left-hand side of the programs interface I have chosen a 'cube'-like shape. Other shapes are available too, such as a 'ball' or a 'cylinder'.

Another thing worth mentioning is the image of a camera in the middle of the canvas (i.e. grid area). The '100' value in the right-hand top means that the zoom of the camera is at 100%, the default.

Lets crack on with a TOP view of the canvas.


Grey shape in TOP view of the canvas

Here you will notice two more pieces of information.

Time: set to 0.0
Frame: set to 0

These values indicate that we are at the start of a possible animation through time and space (i.e. frame).

So, welcome.... you have now been transported to our first Virtual Space !

.....

Next, I have added four 'cylinders', that will change our freshly made model into an hourglass, as you can see from the FRONT view.


4 pillars from cylinder shapes in FRONT view of the canvas

If I turn the scene's display mode to a wireframe (showing only the contours) and we perceive the model from the Camera point-of-view, the hourglass is much more recognizable.


Hourglass in wireframe display mode from Camera perspective

.....

An hourglass is not much good without a glass. Therefore, I have added an approximating curve to the model.
To work more secure this time, the grid is at a lower interval and I have zoomed in to 200%.


Approximating curve that defines the contour of the upcoming glass.

The tools menu have an option called 'lathe' which turns the line into a 3D object, centered around its y-axis.


Curve changed to lathed object.

......

Next we should illuminate the scene. Art of Illusion supports three types of light sources: point lights, directional lights and spot lights. We'll use the simplest of them, the point light to correctly illuminate the scene. Since the camera only picks up an object when light shines on it, the light source and the camera have to be at the same side of the hourglass. To find the camera I have zoomed out to 30% in FRONT view of the canvas.


Camera found, its the one on the right-hand side in the FRONT view with the red markers.

Placing the light source on the canvas and setting the following parameters from the Object -> Object Layout menu to it:

- The default Intensity value 1.0 is a bit high, resulting in picture that looks like the camera was blinded by the light. Changed the intensity value to 0.8.

- Set the Decay Rate to zero. This value determines how fast light intensity decays over distance. In reality, light intensity decay is related to the squared distance. The default Decay Rate would result in a very dark image.


Light source added, as indicated by the red markers

.......

We have lived long enough in a 'wire-framed' virtual space, it's time we enhance the model to a real feel through rendering.


Our hourglass after rendering (i.e. instructing the computer to make images of the space) from the Scene -> Render Scene menu.

NOTICE: The angle in which we see the rendered hourglass is due to the Camera looking from an angle. And not from the FRONT as we have seen the hourglass in previous images.

Still, I find the model very dull.... just grey with no colors or textures ;o(

.......

WOOD TEXTURE

Hence, we will texturize the wooden frame. The Scene -> Textures menu lets me define a new Wood texture.


New Wood texture in the making

3D procedural textures determine color, roughness, reflection and other surface properties as a function of 3D coordinates. For any position in space, the texture defines what a shape's surface looks like, as if we had cut the shape out of a solid block of this 'material'.

Since Wood is formed from a pattern I select 'Wood' from the Insert -> Patterns menu.


Wood Pattern selected

Besides a pattern the hourglass wooden parts need a custom color, as can be selected from the Insert -> Color Functions menu.


Custom Color Function selected

Now, the power of software becomes visible when I connect the Wood Pattern box to the Custom Color Function box, which in turn is connected to the Diffuse color component. See, the little Preview window in the left-hand bottom corner reflects a Wood texture!


As by magic, the texture of wood becomes visible

Yahooo.... lets color our wood with a bit of yellow by double-clicking the Custom Color Function box!


Custom Color Function set to varying shades of yellow, mimicking wood

And preview how changing the Wood Pattern box properties has realized a wood 'feel'


Wood pattern and color

Time to return to the hourglass, to apply our newly created Wood texture to it!

.....

Selecting Object -> Set Texture for the Top and Bottom parts as well as the Pillars of the hourglass and choosing our newly created Wood has turned them into the following:


Wood assigned to Top and Bottom parts of the Hourglass


Wood assigned to the pillars of the Hourglass

Which - when we select Scene -> Render Scene - leaves us with a wonderful wooden frame around the hourglass.


Rendered result of wooden frame creation

.....

Almost finished... I left the most exciting bit to the end: Glass!

To complete the model, next the glass part is to be turned into realistically-looking glass.

First we'll create the glass texture (for transparency), and then the glass material (for reflections).

GLASS TEXTURE

In the Scene -> Textures' dialog, I create a new Uniform Texture called Glass. This texture makes the surface transparent, so the inside material will be visible, and it determines the amount of specular reflection.


Glass texture in the making

Transparency is controlled by both the Transparent Color and the Transparency value.

The red, green and blue fraction of the transparent color determine how much of each color component remains when light passes through the surface. It is a filter color. White, the default color, means that light of any colors passes the surface. Black means no light passes.

The transparency value determines the total fraction of the light that passes though. A value of 0.7 means that 70 percent of the light is let through the surface. This also means that the transparent component determines the color of the surface for 70 percent.

The remaining 30 percent of color will be determined for 100 percent by reflection, so the Specular value will be set to 1.0.

The surface's diffuse component does not affect the total color with these settings. We'll use the objects material to color the glass.

GLASS MATERIAL

In the Scene -> Materials' dialog, I create a new Uniform Material also called Glass.


Glass material in the making

The color of a material is affected by two parameters: Material (i.e. Emissive) Color and Transparent Color. Both colors parameters attenuate the color of the light as it passes through the material.

Material color only affects the light that reaches the camera directly, it is the color that the object appears to have.

Transparent Color affects all light passing though the object, and also colors the shadows cast by the object.

The first color parameter is easier to use though because it species what color the object will look like. Transparent color however, specifies the fraction of red, green and blue that passes through. The rest of the light is reflected and determines the objects color.

How much the light is attenuated is determined by the Density value. A value of zero results in no attenuation. For this glass material I specified a simple green material color that only shows on very massive objects.

Lastly I have selected the lathed object (i.e. the glass of the hourglass) on the canvas set Object -> Set Texture to Glass and Object -> Set Material to Glass.

That's it for the glass.

.....

RENDERING THE MODEL

In the Scene -> Render Scene' dialog, I chose Raytracer.



Render settings for the model

The raytracer casts 'rays of light' from the camera back to where they intersect objects. At this point on the object, rays are cast towards the light source to calculate lighting and find shadows. From objects with a specular reflection component or transparency, new rays are cast to find objects seen in reflections or though transparent material.

Now rendering results in the following.



Hourglass after rendering

Quite a nice result, all be it with a transparent (i.e. white) background set in the render output settings we can be really pleased!



End result of an hourglass created in virtual space

... took me about an hour ;o)

(the original tutorial can be found at http://www.artofillusion.org/docs/hourglasstut/index)

No comments: