Introduction to trueSpace 3.2 | Print |
Article Index
Introduction to trueSpace 3.2
Creating a Chrome Sphere
Making the chrome ball reflective
Why use polygons?
Creating an extrusion
Exploring ray tracing
Environment mapping
Smoothing the surface
Sweeps
Spherical mapping
Cylindrical mapping
Image and bump mapping
All Pages

Preamble: trueSpace is a wonderful rendering environment and a confusing modeling environment, so I'll spend more time on rendering than modeling in this series. TrueSpace uses the left, the right, and both mouse buttons depressed, unlike a lot of other programs: we'll get to this a little later.

To get going, download trueSpace from Caligari's server (click on this dot) Last we looked, they were offering version 3.2 for free. If they've changed their minds, the steps to follow are compatible with trial, later versions you can download from there.


1.) Okay, the first thing you want to do is get rid of that damned menu bar at the bottom of the screen and put it on top where it belongs. Choose File>Preferences> and then choose TopMenu.

2.) The view you open to the very first time in trueSpace has two point lights in the scene, and no camera. It is not critical to fuss with the lights just yet (we'll tackle that in a future tutorial), but it is necessary to view a scene through a camera: if you don't, you will eventually switch views and never see the default view again, and this messes up the rendering of a scene. As you can see in figure 1, I've left-clicked and held on the camera and light pull-down. Release the pull-down when your cursor is over the camera, and a camera wireframe will appear in the scene.

3.) Now, let's go to a top view of the scene, so we might position the camera and the object we will soon add to the scene. Drag on the face of the Views pull-down, and then release when you see the top of a house (see figure 2) BTW, the figures also tell you which mouse button to use. Your view is now of the top of the scene, but you might not be able to see the camera, `cause you're too far zoomed in.


4.) Drag using both mouse buttons on the zoom in/out button (see figure 3) until you can see the camera. You'll notice later that there's a group of three icons that look like move, scale, and rotate scene, and these are for rotating, scaling, and moving objects, and not your view (this nicety screwed me up royally when I was learning the program).

5.) Let's add a sphere to the scene because why not? Click+drag on the objects pull-down, and then release when your cursor is over the sphere shape (see figure 4). The sphere is added to the scene. If you cannot see both it and the camera (you guessed it): use the zoom out feature again.


6.) Now, you want to move the sphere (I'm guessing) closer to the camera. In figure 4, you can see the move object icon highlighted. Click the Sphere with the pick tool to select it, then click on the Move tool, and drag the sphere closer to the camera (figure 5).

7.) Similarly, you might want to move the camera closer to the sphere (see figure 6...hey, we're playing here, we don't go for points, but instead an overall familiarity with the program).

8.) Let's looky through the camera now to see the sphere. Ooops...I forget...you might also want to move the lights closer to the sphere. But you know how to do this with the Move Object tool now, right?

9.) Drag on the face of the views pull-down until you hit the tiny icon of the camera, and then let go (figure 7). Now, you are looking through the lens of the camera, and you can come back to this view over and over again in the future. Oh, by the way, it's not documented (of course, thank you, Caligari) but Ctrl+Z will undo your last edit.

Okay, the sphere might not be framed perfectly by the camera view, and this could be due to a number of things, not in the least that it might be centered along the width axis (called the X axis), and the depth axis (how far away from the camera, also called the Z axis), but the sphere might be too high in the frame (the Y axis). To fix this, click on the sphere with the pick tool if it's not currently selected (you'll notice that stuff in wireframe highlights when it's seected), and then choose the Move object tool, and right-click to move the sphere up and down. This is an anomaly in trueSpace; camera views require the specific use of the left or the right click to move objects left and right or up and down, while other, non-camera views aren't fussy about the mouse button..

Once it's centered in frame, the sphere might be too large. To shrink it , choose the Scale Object icon (see figure 8) hold both mouse buttons. And drag downward.

10.) Here's the payoff and the end of this section. To render the sphere, that is, take the wireframe and command the program to put a "skin" on it and make the scene's info capable of being imported to Photoshop as a bitmap (Targa, TIFF, and so on), check out figure 9. You click+drag on the render pull-down and choose the render scene icon.

You are rendering to screen here and not to file. We've got a ways to go before you wind up with a 3D rendering or wireframe that's a "keeper". BUT...I do want you all to keep this lesson as Lesson 1.scn to your hard disk. Choose File>Scene >Save As, and get yourself a special folder for the stuff yet to come.



Next, I'll show you how to do the famous, near-ubiquitous floating chrome sphere!

In lesson 1we left off at creating a sphere, pointing a camera at it, centering it, and doing a render to screen. In this episode, we're going to cover a lot more ground. We will create a duplicate of the sphere, position it, light it, and then render it using shadows!

First points first: in order to navigate, and to accurately position things in 3D space, you need to work in two views. Because trueSpace only shows you one view at a time, to accurately position stuff, you need to center something from one view, and then from a second view. You'll see...

1.) Open the file you saved in Lesson 1.

2.) Click+drag with the left mouse button depressed on the views pull-down and then choose the ¾ view, as shown in figure 10. This gives you a pretty good view of the whole scene, and depending on your screen resolution, you might or might not see all three of the point lights in the scene...those things that look like little cartoon explosions (figure 11). With the pick tool (click on it to make sure it's selected from the tool box), click on a point light and then press Delete. Do this with the next one, and if you cannot see the third, click on the Scale view icon on the views toolbox and then pull down holding both mouse buttons in the scene to scale it back, find that damned last light icon and then choose the Pick tool again, click on the furball and press Delete.

3.) Now, click+drag on the lights pull-down (figure 12), and release the left mouse button when it's over the Infinite Light. This adds an infinite light right in the center of the scene (where you do not want it), as you can see in figure 12.

4.) In figure 12b, let's slow down a tad. This light properties box pops up every time you create a new light, and every time you click on a light icon. I'll provide definitions now because Caligari thinks a dialog box with text is ugly or something: A is the color field: you drag in the box to set the color of the light—for now, it's probably best to keep the light white.

B is a slider that controls the strength of the light. Drag it up to about the 2/3rds point now.

C describes the fall-off of the light. The top button should remain the choice, although this is an unnatural choice for real-world lighting, which is no fall-off, that is, the light does not decrease in intensity regardless of its distance from an object. The middle button describes linear fall-off... the chosen light's intensity falls off as a direct function of distance. The third choice is an algorithymic fall-off...the best choice for realistic scene lighting. Light falls off as a square function of distance between the chosen light and the object it illuminates. Fall-off is sort of meaningful only when you have a lot of objects at different distances from light sources in a scene, and all we have right now is a sphere, so no fall-off is the best choice.

D at top, is the "no shadow" button: the light will not cast a shadow. Click the bottom button, though. We want a pay-off to all this learning nonsense, and to render spheres with shadows in the screen render at the end of this lesson. Unlike in nature, you can have one light casting a shadow, and another one not casting a shadow in the same scene.

6.)Click on the camera in the scene, and then click+drag on the (world space, as opposed to the scene) views pull-down, and then click on the camera icon. Now, you're looking at the scene through the camera, and you view is too close to add another object, so we change the view...

7.)Click on the Scale view icon on the views toolpanel, and then in the scene, drag using both mouse buttons to zoom out of the scene. See figure 16.


8. Click on the sphere using the Pick tool, and then press Ctrl+C. Doing this copies the sphere and the new sphere occupies the exact same space as the original sphere. Let's move it because it's a drag to render two spheres that occupy the same coordinates in space!

9. Click on the Object Move tool. From the camera view, left click+dragging drags an object left and right, and right-click dragging moves it up and down. Left click+drag on the sphere, as seen in figure 18, and only move the sphere about this far, as shown.

10. To get a little artistic and to show another step, let's decrease the size of this duplicate sphere. With the 2nd sphere selected, click+drag on the object change pull-down and choose the scale button, as shown up top left in figure 18. Then, hold both mouse buttons and drag on the sphere to make it smaller. Go to the views pull-down and choose (Scene) top, and then choose the Move Object tool, and move the duplicate to the (stage) right of the original sphere, as shown in figure 19.

11.) With the Pick tool, click on the camera in the scene and then choose the camera icon from the views pull-down on the tool panel. NEVER, never click on the camera icon if the camera is not selected in the scene. If you do, your view will be taken to the view of a light or other selected object in the scene's view of the scene—like a light's view of the scene. Highly unusual and seldom wanted!

Finally, as you can see in figure 22, the render of the scene has a shadow in it, where the small sphere eclipses the bigger one. And we'd not have a shadow here if the Infinite light were not positioned and pointed in such a way as to create the effect. Optically, and realistically correct!

 



Okay, you're gaining confidence in lighting, and rendering with shadows in trueSpace. Now, let's ease back on the pace of these tutorials, and dwell a little bit on the glitzy super-realistic properties of reflective surfaces. In English, you're going to make a reflective chrome ball now.

1.)Open the file you created and saved last, with the smaller sphere in front of the larger one.
2.)With the Pick tool, click on the larger sphere in the scene to highlight it and then right-click on the paint application icon, as shown in figure 23. You'll see panels open in the workspace, all relating to surface properties of the object (the sphere), as you see in figure 24. Except the panels on your screen probably aren't lettered...

Paint Application Icon
Surface properties palettes

 

3.) Before doing anything, let's get a grasp on what the panels do. At far left is a color space and a tone slider. You use these to define a color for the surface of an object, and this panel operates just like the light color panel you used last week. By the way, a surface color is negated if you ever put a bitmap surface (called an image map) on an object.

4.) Next to the color definition panel, is the Material preview panel. What you see in this panel is what is loaded to apply to an object. Alternately, if you sample a surface (but we won't cover that right now), the Material preview shows what you are going to apply to an object. There are many, many surface properties, and by learning what these controls do in trueSpace, you'll better be able in the future to make plastic objects look like plastic, wooden objects look like George Bush's head and so on.

5.) Next step: The shaders Map panel. What is a shader? A shader is a component property that defines the surface of an object. In the real world, you might say that something is shiny, but rough. In the world of 3D modeling, "rough" has a control, and "shiny" has a control; the mix is called a shader. Callout a is the amount of smoothing applied to a wireframe model; the top is faceted (no smoothing), the middle is normal, and the bottom button is smooth. The reason why we need these controls is because a wireframe model is made up of straight line vectors, so a sphere with few vectors is going to look funky unless you tell trueSpace to smooth vertices on a clunky-looking object. We will not be using these controls this week, and in general, if your model needs smoothing, there are other, better ways I'll discuss in the future for accomplishing this goal. Callout b is the object property column; on top, is a flat shading for an object, in the middle is the plastic button, and on the bottom is the metal button. These buttons are actually shortcuts to defining a surface-the last panel we explore here can control the sub-properties of, for example, the metal preset. We could in fact choose metal for one of the spheres, and then make the sphere have a rougher, less reflective surface. Try doing this in real life...

6.) Callout C is for image mapping, which deserves an article of its own. To oversimplify, James Blinn, the grandfather of synthetic imagery, devised a way to "paste" a bitmap image onto the surface of a 3D object. It's called image mapping. Now, the top button is for simple image mapping: if you want to put a pattern on a ball, you'd create the pattern in something like Photoshop, and then click on the top button, then right-click on the button to call up a directory box where you locate the pattern image (read this last sentence twice...it is totally un-intuitive to have to left and then right-click to set up the pattern map. And THEN, you have to apply it to the selected object, but I'm getting ahead of myself here. The middle button is for bump mapping. James Blinn's invention again—you create areas of grey in an image, save it and then use it in trueSpace to simulate heights and recesses on the surface of an object without having to actually sculpt every nook and cranny onto the surface. We'll get more into bump mapping in the future. The bottom button, the one we'll use this week, is reflection mapping. Now, trueSpace can render reflections into a scene just fine, thank you, but there will be occasions (I'll point them out in a moment) when you want to use an image instead of telling trueSpace to calculate actual reflections within the scene.

7.) Callout D points to all the procedural textures that trueSpace offers. Okay, what's a procedural texture? A procedure is kind of a math recipe that leads the programmer to offer up something that in the context of surfaces in the 3D realm, obviates the need to use an image map. IOW, a procedural texture of granite (the top button below the D callout) produces a granite look applied to a sphere, for example, without the need to paint a faithful replica (or use an actual photo of) real granite. The advantages of using a procedural texture are 2: First, because the granite (marble, or whatever) is rendered from a math formula onto the surface of an object, it can be scaled up or down without the blurring that would take place if you used a bitmap to image map the look. Also, many procedural textures are called "3D textures", because there is continuity across the faces of an object. Huh? Okay, let's suppose you create half a sphere (also called a hemisphere by people brighter than Bouton). If you used a bitmap to make a surface wooden in appearance, the mapping would abruptly change as the bitmap travels across the smooth surface only to hit the end of the hemisphere. It just would—trust me for the moment. But using s 3D procedural texture, the object would have a smooth wood grain transition from the curved to the flat areas on the hemisphere.

 



As you saw in the last section, the sphere was smooth and did not show vertices along its silhouette (in English, the outline looked circular and not like a bunch of straight vectors connected). In reality, that is, contrary to what you see on screen, 3D models are composed of straight line vectors and/or polygons—at one point of modeling or another, and not the smooth flowing shapes you might see onscreen. Why? Because 3D shapes can have hundreds of undulations along its surface, and it is most economical from a computing standpoint to create polygons to describe the surface changes in direction. By default, when you create a sphere for the first time in trueSpace, the sphere is made up of a lattice that are 8 in number up and down (latitudinal) and 8 units from side to side (longitudinally). Now, if we were to view this sphere from a sufficiently distant standpoint, it might look fine rendered, when its structure is of a resolution of only 8 by 8. However, as we've seen (up close) the sphere looks funky when this few number of vectors describe a purportedly smooth sphere.

Create a coarse (8 by 8) sphere, set the subdivision angle, and then perform a smooth quad divide on the sphere. Then render it and see how you feel about its smoothness. It must be said that if you are creating a sphere from the get-go, defining a high resolution is better than subdividing it later.
 


Moving on, let's start a section on how to create extrusions and sweeps in trueSpace. An extrusion is the performance of pushing a path in a backward or forward direction to define the depth axis of an object (a path) that already has height and width. A sweep is the same as an extrusion, except the path is pushed forward or backward a number of times, and each time, the 2D path can take a new size, direction, or rotation. This will make sense in a moment, when we create a heart with a bevel edge.

The easiest way to get a path into the workspace is to add one from the path library. Click and drag on the pull-down panel directly to the right of the keyframe editor panel, and then let go when your cursor is over the green heart and circle icon. In figure 34, I'm click on the Heart title to add a spline (a sort of vector that can be curved) of a heart to the workspace. I'd suggest, as also shown in figure 34, that you choose the ¾ view of the workspace, because the heart spline is a 2D object in 3D space, perfectly parallel to the floor, and that means that at certain viewing angles, it'll be hard or impossible to find.

Now that you can see the heart shape, it's time to sweep it. Right-click on the Sweep tool on the toolbox (see the inset image in figure 35) to display the settings for the sweep. The defaults are fine for this experiment—as you can see in figure 35, only the Z aspect of the space—the depth we'll add to the heart—has a value on the palette. As soon as you left click on the Sweep icon with the heart selected, a new spline appears in green above the original heart, and there are connectors between the first and second hearts. This is a wireframe view of a straight extrude function. Also, you'll note that a point Nav(igation) menu has cropped up. Marvelous! We will use this handy little box in a moment.

Now, the entire top heart is green, and that means that the whole top heart is available for editing. What we want to do to create a bevel edge heart is to make the top heart smaller than the original—and all the vectors (the vertices) connecting the two shapes will change and accommodate. Click on the Scale icon on the Point Nav menu, as shown in figure 36, and then while holding both mouse buttons, drag up or down to scale the whole heart larger or smaller. I don't care which.

Congratulations! You've created a bevel edge heart.


Reflective stuff is attractive...it's that simple (I think it's in our gene coding or something), but it's not as easy as you might think to pull off a visually compelling reflective piece in trueSpace, oddly, for exactly the reason why trueSpace's rendering engine is so sophisticated. TrueSpace uses raytracing, which is a fancy way of saying that an invisible shaft bounces from the viewpoint (the camera) to various reflective points within the scene, and then traces back to the camera's point of view to "report" that certain pixels in the finished rendered scene are reflections of objects in the scene. Let's just say that raytracing is an incredibly processor-intensive thing, and it's not always a necessary thing to make beautiful images.

(Digression #1: We are working at a disadvantage in this lesson because the object we will make reflective is a sphere. And a sphere shows EVERYTHING in crystal clear detail when it bounces a reflection back at the camera. Usually, reflective objects twist and turn and reflection get very distorted and it is easier to "fake" a reflection...as we will do shortly...with convincing results)

Let's check out this metallic property by applying it to the two spheres and then rendering it with raytracing enabled.

1.) With the big sphere selected, click on the metallic button on the shader map panel, and then click+drag on the material application pull-down, and choose the funnel—this applies the metal shader (material) to the sphere.

2.) Do step one with the smaller sphere.

3.) Now, right-click on the render icon on the toolbox (it's the little cube doober to the left of the views icon pull-down list). Make sure on the render options panel that pops up that Raytrace is checked.

4.) Drag on the face of the render icon and then choose the render scene icon.

As you can see in figure 25, the render is sort of a dud. You know why? There's nothing really in the scene to raytrace...nothing to reflect!


Now, I'm simply trying to show you that reflections...mathematically accurate ones, sort of demand a scene in which to reflect. In figure 26, you can see (if you squint.) that the sphere injected into this scene is indeed reflecting its surroundings. See figure 27 for a close-up of the magic, reflecting sphere.

Admittedly, however, it's a drag to have to model an entire scene just to make a reflective object look interesting. Enter truSpace's environment mapping feature (and for this lesson, enter Vue d'Esprit, a Bryce-type terrain modeler that is better than Bryce).

In art as in life, the contents of a reflection have become iconized. We expect to see a "hub cap's" view of a clear blue sky on the top, brown earth on the bottom, and perhaps a tree of two framing the edges of the reflection.

Try this to simulate and gain more 3D experience:

5.) Copy image 28 to your hard disk, trim it using Photoshop or a Photoshop-compatible image editor, and then save it as reflection.jpg to your hard drive.

6.) With either sphere selected, click on the environment map button on the shader map panel, and then right-click on the button to reveal the directory box.

7.) Path your way to the environment map (image 28) on your hard drive, and then select it for this lesson.

8.) Click on the funnel icon on the toolbox (technically, it's called the "Paint Object" tool), and then repeat steps 6 through this one to the other sphere.

9.) Do a screen render (click on the Render Scene icon on the rendering pull-down list on the toolbox).

Now, figure 29 is pretty darned handsome-looking, isn't it? But it's not really the end of your adventure making image maps for reflective objects instead of having to build a whole scene for which the object reflects. In figure 30, I've created a blurry image out of a black and white image of a small Austrian village (I found the image in a clip image service). What the blurring does (which is optically incorrect but artistically nice...reflections, if you look, are never blurred unless the source image is blurred and I've never seen a blurry village) is add depth to the scene, the little sphere is still reflecting itself into the big sphere (which helps integrate the elements in the scene), and the black and white-ness of the environment map makes the scene look a little more crisp and metallic in appearance.

 

You will want to experiment and make variations on figure 28 (reflection.jpg). A good trick is to photograph scenes and then use Photoshop's Polar Coordinate filter to mess the scene up and then use it as an environment map. Be a good magician: misdirect the viewer and show them only what they expect to see!



By the way, if you check into figure 30 again, you'll notice that Bouton pulled a fast one and the spheres are round and not faceted in appearance. How do you do that?

When I ended our last lesson, I pointed out that the sphere was smooth and did not show vertices along its silhouette (in English, the outline looked circular and not like a bunch of straight vectors connected). In reality, that is, contrary to what you see on screen, 3D models are composed of straight line vectors and/or polygons—at one point of modeling or another, and not the smooth flowing shapes you might see onscreen. Why? Because 3D shapes can have hundreds of undulations along its surface, and it is most economical from a computing standpoint to create polygons to describe the surface changes in direction. By default, when you create a sphere for the first time in trueSpace, the sphere is made up of a lattice that are 8 in number up and down (latitudinal) and 8 units from side to side (longitudinally). Now, if we were to view this sphere from a sufficiently distant standpoint, it might look fine rendered, when its structure is of a resolution of only 8 by 8. However, as we've seen (up close) the sphere looks funky when this few number of vectors describe a purportedly smooth sphere.

1.) Right-click and hold on the objects pull-down menu on the toolbox until your cursor is over the sphere icon, and then release. You'll get a menu titled "Sphere", with fields for Longitude and Latitude, and you have not yet littered the workspace with another sphere by using the right-click+drag technique.

2.) Type 35 in both the Lat and Long. Fields and then get your view set up in the window so you can see the creation of a new sphere. Me? I deleted the spheres from lesson 3, having lost my amusement for reflective spheres. I'd recommend an overhead view; zoom back as you've learned to do in past lessons so you can see the camera from this view.

3.) Now, click on the Sphere icon. Voila! A new sphere is created that looks like a very dense wireframe. Perhaps the density (the resolution) for the mesh is overkill for a simple rendering, but rest assured that if you want to zoom way in so only part of the surface is visible, like a satellite photo of the earth, the sphere will be perfectly smooth. I'd recommend a density of about 15 for long and lat for most spheres you want to be smooth.

Okay, now what do you do when you've already created or imported a mesh that's blocky looky from too few vectors? You right-drag on the divisions pull-down on the toolbox, and let go when your cursor is over the smooth quad divide icon, as shown in figure 31.

 

I'm not a math wizard, so I cannot tell you what, at any given resolution of vectors are the interior angles of this sphere, but I can tell you that any angle is greater than 80 degrees. So what you do is specify an amount in the subdivision menu's field, choose the sphere with the Pick tool, and then click on the Smooth Quad Divide icon, as shown in figure 32.

 

 

In figure 33, you can see that the coarse sphere is now more refined, with additional latticework in its mesh, and if you want to try this yourself, go for it:

Create a coarse (8 by 8) sphere, set the subdivision angle, and then perform a smooth quad divide on the sphere. Then render it and see how you feel about its smoothness. It must be said that if you are creating a sphere from the get-go, defining a high resolution is better than subdividing it later.


 

Moving on, let's start a section on how to create extrusions and sweeps in trueSpace. An extrusion is the performance of pushing a path in a backward or forward direction to define the depth axis of an object (a path) that already has height and width. A sweep is the same as an extrusion, except the path is pushed forward or backward a number of times, and each time, the 2D path can take a new size, direction, or rotation. This will make sense in a moment, when we create a heart with a bevel edge.

The easiest way to get a path into the workspace is to add one from the path library. Click and drag on the pull-down panel directly to the right of the keyframe editor panel, and then let go when your cursor is over the green heart and circle icon. In figure 34, I'm click on the Heart title to add a spline (a sort of vector that can be curved) of a heart to the workspace. I'd suggest, as also shown in figure 34, that you choose the ¾ view of the workspace, because the heart spline is a 2D object in 3D space, perfectly parallel to the floor, and that means that at certain viewing angles, it'll be hard or impossible to find.

 

Now that you can see the heart shape, it's time to sweep it. Right-click on the Sweep tool on the toolbox (see the inset image in figure 35) to display the settings for the sweep. The defaults are fine for this experiment—as you can see in figure 35, only the Z aspect of the space—the depth we'll add to the heart—has a value on the palette. As soon as you left click on the Sweep icon with the heart selected, a new spline appears in green above the original heart, and there are connectors between the first and second hearts. This is a wireframe view of a straight extrude function. Also, you'll note that a point Nav(igation) menu has cropped up. Marvelous! We will use this handy little box in a moment.

Now, the entire top heart is green, and that means that the whole top heart is available for editing. What we want to do to create a bevel edge heart is to make the top heart smaller than the original—and all the vectors (the vertices) connecting the two shapes will change and accommodate. Click on the Scale icon on the Point Nav menu, as shown in figure 36, and then while holding both mouse buttons, drag up or down to scale the whole heart larger or smaller; I don't care which :)


Congratulations! You've created a bevel edge heart.


 

Moving on to the second from the left icon on the UV mapping: Spherical mapping. As the name clearly indicates, this mapping type is ideal for plotting a 2D image across the surface of a round object. As opposed to the linear mapping, there will be no indication as to what direction is right-side up when you apply the mapping wireframe to a sphere. Let's try this:

1.) Go create a black square with a white circle in the center and a black "8" in the center of the white circle.

2.) Create a sphere in the scene and get rid of the cube.

3.) Load the 8 ball image as the texture and load the wireframe from the UV mapping panel around the sphere in sphere mapping mode (click on the sphere icon on the UV panel).

You'll see a sphere wireframe, a little larger than the sphere (this is okay, it's natural, don't panic at the size), and in orange, there is a half-circle making up the wireframe. The trick is to get the orange "slice" to be parallel to the front of your view, and to the right of the circle. And to do this, you use the Object rotate tool again. See figure 44. The right side of the sphere is where an image starts mapping. If you were to look overhead at the scene right now, the orange slice...the origin point for the mapping, would be at 3 o'clock.

Finally, what you want to do is to map the 8-ball design to the sphere twice vertically and once horizontally. Why? Because the sucker wraps around the sphere for both the front and back side. You have your choice here in mapping spheres on your own: if you want an 8-ball pattern for example, to only map once on the front face, you then create an image map where the "8" design is skinny, precisely half as wide as it should be, and map it at one revolution around the sphere, or do what I've explained above. No one is going to see the second "8" from the back unless you animate the sphere.

This should give you already some idea of the distortion in 3D space an image suffers when you map it to a curved surface. The reason why no artifacting goes on (or very little visible artifacting) is because trueSpace has anti-aliasing capability: it slightly blurs (averages) the pixels in the image so they more "comfortably" stretch and pinch along 3D curved surfaces.
 


 

Last time, we took a look at cubic, linear and spherical mapping, but I ran out of pixels, and we didn't cover cylindrical mapping. Cylindrical mapping, like linear mapping, maps a design smoothly across the facing area of a shape, but smears on the top and bottom lip of a cylindrical shape. But we will solve this problem in this week's lesson, and also explore a little bump mapping. And we'll get a little more into the types of images you'll want to create to make 3D objects look more visually complex. Additionally, we'll take a whack at bump and transparency mapping.

First, you need to open trueSpace, and create a cylinder that's about the proportions of a soft drink can.

1.) Use the document upon which you worked last time. On the toolbar, click+drag on the objects pull-down and then release the cursor when it's over the cylinder icon. You'll probably need to choose a different view (top view is good) and then move the cylinder so it's in front of the camera. You can delete the other shapes in the scene. You might also want to scale the cylinder. Now, the cylinder is not the correct proportions but that's not an immediate concern. We want to apply UV mapping next.

2.) Click+drag on the Material Library icon on the toolbar's pull-down menu (or just click on the UV mapping tool if it's on the top) and then choose the UV mapping tool. Click on the cylinder on the UV mapping panel, and then choose the Object rotate tool on the toolbox's object move pull-down. Carefully, with both mouse buttons depressed, rotate the wireframe (mapping wireframe) so that the wireframe is perched symmetrically on the cylinder shape. Then, using the right mouse button, drag on the wireframe so that the orange highlight is perfectly to the right of the object and wireframe. See figure 45.

The mapping on the cylinder will start at the right (the orange part of the UV mapping wireframe should be at a 3 o'clock position if you look at the scene from overhead...oh, and you can switch views before committing to the UV mapping—this is not a "modeful" UV mapping step.

3.) Let's move to a side view. The scale tool always acts relative to your view on an object. Therefore, because the cylinder needs to be taller to be a soft drink can, a side view and a tug straight up (not side to side in the least) while holding the Object Scale tool and the left mouse button will increase the height only of the cylinder. See figure 46.

4.) Take a break for a moment and download figure 47; crop the image using your favorite image editor (save it to Targa, BMP, or JPG format) and let's look at what I've done and why.

The proportions of the design are around 300 pixels wide by 225 pixels high. This seems to work for mapping a shape that is roughly soft drink can in proportions. This is not a magic number, and I'm sure through experimenting, you can come up with optimal mapping dimensions. This sounds nuts, but why not take the label off a real can and measure it?

 The can design has a repeat of twice, once for the front and once for the back of the can. You need to do this with cylindrical and spherical mapping if you want to put a "decal" (a piece of signature or label design) on a surface of a 3D object.

 The design ends at the right edge where it begins at the left edge. That is, I kept the solid red at the left and right edges of the can.

 Even though it's only be a pixel or two, I kept all design elements away from the top and bottom of the design. This is because unless you map the cylinder using the UV tool perfectly to the cylinder, there will be some smearing over the top and bottom lips of the cylinder. And it's darned hard to do this perfectly.

Let's map the soft drink label, or better still, create your own design. It's okay; I'll sit here and wait while you do it.

1.)Right-click on the funnel icon on the toolbox, and then click the texture icon on the shadermaps panel. The Texture Map panel pops up and if you click on the top button, you can search your drive for that soft drink can design (label).

2.) Set the repetitions to 1 U and 1V.

3.) If you like, increase the reflectivity of the can's surface. You can apply surface properties to the cylinder with a bitmap on the cylinder, or without one.

4.) With the cylinder chosen, left-click on the funnel icon to apply the surface properties to the cylinder, and you can see the results onscreen before you, or in figure 48. Play with the lighting a little, too. The higher the gloss (smoothness or reflectivity), the less light arrives back at the camera after bouncing off the shiny object.


Let's try some image mapping and bump mapping on this cylinder next. We'll see a problem and overcome it. C'mon...

1.) Copy figure 49 to your image editor and precisely crop the two images and save them as Blob01.bmp and Blob01m.bmp (the "m" is an extension for "mask"; if you collect zillions of texture files, the "m" helps you quickly find greyscale bump maps. I guess you could use a "b" instead, too) The image should be perfectly square.

2.) Load the blob01 image in the TextureMap panel, as shown in figure 50. Set the number of vertical and horizontal repetitions to 3, because why not? Fill and render the cylinder. As you can see in figure 50, the top of the cylinder has a mapping problem. Oh, ****. Rotate the cylinder toward you to see what I'm going on about here.

3.) When a cylindrical mapping doesn't work on a cylinder, there is absolutely no reason why you can't choose a different mapping type. Click on the UV mapping tool (the swimming goggles on the sphere drawing), and choose Spherical mapping.

4.) With the Rotate tool, make sure the mapping wireframe's polar ends are perfectly at a perpendicular angle to the front of your view. This is a tough one to describe.

What is happening is that you are removing from your current view the polar caps where a sphere mapping will "pucker" the 2D image map. From your view of the cylinder (make sure you've got the cylinder pointing toward you for maximum effect...."3D" is diminished in visual "pow" if you don't try to show more than one perspective point of the object).

5.) Render the cylinder now. Pretty neat, huh? Now, this is a "patch" but not a perfect solution to the cylinder mapping problem.

If you move the cylinder around in 3D space now (use the Object Rotate tool), you might see the "pucker" point(s) on the surface, but the pattern is pretty obnoxious and complex, helping to disguise it a little.

What, oh, what would be the perfect mapping solution? You'd need a three-piece cylinder-a top disk, a bottom disk, and then the cylinder. You'd map the cylinder cylindrically, and use a linear mapping on the top and bottom disks. And I guarantee it would take hours, because there will be an edge discontinuity where the disks meet the cylinder.

That's about it for this series of lessons, but stay tuned, because there's more to learn, and I have more to write!

--Gary David Bouton


Copyright

Copyright Contents Copyright © 1994 - 2005 Gary David Bouton, No material may be reproduced without express permission from the authors. All rights reserved; referenced work belongs to the respective owners.
 
  • TheBoutons.com
    website