|
Hourglass Tutorial
![]() To Documentation Index
IntroductionIn this tutorarial you'll be shown how model a simple object with Art-of-Illusion (AoI), using as an example the hourglass in the picture above. This tutorial does not cover all the feature found in the AoI modeller, there are simply too many, but enough to get you started. You will propably figure out the rest by simply trying, expirimenting, creating cool graphics. If you are allready familiar with 3D modelling, you will propably not need to follow this tuturial step by step. You might leaf through it to get some idea of the programs capabilities, but please go and just try it out yourself. For you newbies: I'll get you going making your own 3D graphics in just a few minutes. For the sake of completeness, an AoI scene file called "hourglass.aoi" is distributed with this tutorial that you can simply open with the modeller. However, if you want to learn from this tutorial, you should try building the scene yourself.Look aroundLets assume that you've downloaded the whole bunch of AoI, you've got the right JDK version, read the readme files, and got the thing going. If not, refer to the Art-of-Illusion home page. When you start AOI, you are presented the main screen. On top of the window is you basic menu bar; take a look around, see what's in the pulldowns. If there's a lot up there that you don't understand, don't worry, you will, in time. To the left you see some icons. Clicking them selects a tool and a single line of help is displayed at the bottom of the screen. The icons are:
Getting startedIt's commonly considered good practice to start a 3D modelling session by first sketching your model on grid paper, to get some idea of its dimensions and shape. If you don't, then at least set up a grid in the modeller:
'create cylinder' tool to create a cylinder of the following proportions:
Hints:
'move viewpoint' tool and the 'rotate viewpoint' tool to change the lower-right view (camera1). Now you can see the model from any angle you like. The result should look something like this:
A complex objectThe most complex shape in this scene is the glass bulb. It will be created using the Lathe tool. A lathe is an object created by revolving a spline curve, which determines the contour of the shape, around an axis. To create the contour curve we will use the create approximated curve tool. To avoid painfully precise mouse work, create a first create a finer Grid: spacing 0.2 with 2 subdivisions. Then select Scene->One View from the menu. You can then set the zoom factor of the view to 200 percent. Now create the spline curve by adding the points 1 though 9 shown in the image below (in that order). Double click point 9 to finish the spline curve. Make sure that the first and the last point are nicely on the y axis and tangent to the the top and bottom boxes we made earlier.
The approximated curve is not very intuitive, but allows you to determine the direction of the curve more exactly than the interpolated curve does. The diretion of the curve at the beginning and end of the curve is determined by the only adjectent point. The curve is vertical at point 5 because points 4 and 6 are in both vertically displaced from this point. In general, the curve at any point is determined by the immeadiately preceding and the two next definition points (the curve is a quadratic spline, or, third order spline).
As the central axis of the glass bulb, we will use the line running though the endpoints of the curve. In our drawing, this is the y axis, but by using the first line results in a solid object. To create the lathe, first select the curve and then select Tool->Lathe from the menu. In the lathe dialog, select the Line though endpoints as the lathe axis. (See figure below).
The lathe shape is automatically centered at 0,0,0. This is exactly where we want it, so leave it. (Ofcourse this is no coincidence, I planned it that way!). The spline curve that we created first is now redundant. You may delete it, but you don't have to since it won't show up in the final rendering. To delete an object, select it (from screen or from list of objects) and press del on the keyboard. You may also use the menu option Edit->Clear.
Scene layoutNow we've finished modelling all the shapes. We should try to render the scene with accurate shapes and lighting. Before rendering though, we should determine the layout of the key elements in the scene, the camera and the light. First, determine the position and orientation of the camera. This is easily done using the camera preview in the lower right corner. Translate and rotate the view using the Move view tool and the Rotate view tool. Hold Control while moving the view to zoom in and out. And you may roll the view over by holding Control and using the rotate view tool. You may also position the camera using the move object tool and the rotate object tool or with the Layout object menu option. The camera is an object just like any other. A good position might be one where you can see the top and two other sides of the object.
Next we should illuminate the scene. As you can see there already a light source in the scene from the beginning of the session, Light 1. The light source should be positioned so that it illuminates the side of the object we are looking at. Light 1 is propably not positioned correcty given the position of the camera. Since this lightsource is also far away, we'll delete it and create a new one. AoI supports three types of lightsources: point lights, directional lights and spot lights. We'll use the simplest of them, the point light. Follow The next steps to correctly illuminatre the scene:
Rather boring isn't it ? Everything is a dull white. We want wood and glass, we should add textures.
Textures and materialsWoodLets create a texture that looks like wood. Select Scene->Textures from the menu and press New in the texture dialog. In the next dialog, name the texture Wood and select the procedural 3D type (see dialog below).
3D procedureal 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'. However, for object of which we can actually see the inside, transparent objects, we should use a material to define the inside, not a texture. Textures only determine what the surface of an object looks like.
A function mapping 3D coordinates to the values of teture properies is created by graphically connecting functional components. There are six categories of components:
![]()
The texture doesn't realy look very realistic but it will have to do for now. To create more complex texture, read the section on textures of the the Art-of-Illusion manual.
This texure will be assigned to the top and bottom boards and the sticks in between that we've created earlier. Select all the shapes that should be assiged the Wood texture. Then select Object->Set Texture from the menu. Now select the Wood texture and press O.K.
Now select only the Top and Bottom objects. Again call up the set texture dialog. Now click on the button labeled Edit Mapping. In this dialog, yoou may scale, translate, and rotate the texture to fit the object. We'll only rotate the texure to get the following result:
Now for the sticks. Select them all and edit the mapping mapping again. Create a mapping like this:
Now let's look at the result. The rendered image will look something like this:
GlassThe glass bulb object should have the material properties of glass. That is, it should should be transparent to light and it should also reflect light on the surface. Light that passes through a glass object is refracted and attenuated (e.g. deminuished, change of color). Reflection and transparentcy are texture properties. Refraction and attenuation are properties of an object's material. Materials can only be assigned to solid objects. This makes sense because the amount of attenuation and direction of the light after refraction depends on where a ray of light enters and on where it leaves the object. Fortunately, our bulb shape is a solid object. All lathes shapes with the rotation axis through the begin- and endpoints of the profile curve are solids. First we'll create the glass texture, and then the glass material. In the texture's dialog, 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. The image below shows what settings to use for the new texture. 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 though 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.
To create a new material, select Scene->Materials and click on the New button. The new material may also be named Glass. It should be a uniform material. You can see the parameter settings in the image below.
The color of a material is affect by two paramters: Material 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 paramter 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 though. The rest of the ligh is reflected and determines the objects color.
Howmuch the light is attenuated is determined by the Desnity value. A value of zero results in no attenuation. For this glass material we'll specify a simple green material color that only shows on very massive objects.
The final renderingThe glass we've created cannot be rendered by the raster renderer that we've used for previous renders. Open the render dialog (Scene->Render Scene) and select the Raytracer renderer. 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. The default black background makes the glass material look odd. To improve the aprearence of the glass, we'll set a bright background. Due to a bug in version 0.8 a solid background color results in a incorrect rendering, so we'll use a texture for background. Select Scene->Environment from the menu. In this dialog, select texture-diffuse as a background. You may create a new texture with a diffent color or perhaps a procedural image (clouds make a nice exercise) but I'll use the default texture for now. Finally, to improve the image quality, check the antialiasing option in the render dialog. And if you're (non-directional) light source is near the object, checking soft shadows will result in a more realistic image. Both options cause the raytracer to cast multiple rays per pixel. The results are avaraged to create a smoother image. The minimum and maximum number of rays per pixel to higher values results in better image quality and slower rendering speed. For a quick image, don't use these options. Good qaulity is achieved by setting minimum and maximum to 4 and 16 rays respectively. More rays may be needed for large soft shadow areas. Raytracer settings and the resulting image are shown below:
Imagine itThis is where tutorial ends, but Art of Illusion is capable of much more than shown here. From other tutorials and manuals (at the time of this writing still to be written) you may learn about these. Most of the cool features are intuitive enough though, and you can simply try them all and see their effect. Using the basics from this tutorial you can now start modelling the worlds of your imagination. Gradually, as you learn to master all of the programs features, you'll get better and better... and more addicted. Good luck.![]() |