In this tutorial, I'm going to show you how to make a simple cube in Art of Illusion, and export it to GIMP to create texture, and then import the texture back into Art of Illusion where it can be reassembled and rendered. This process is known as UV mapping. Essentially, its a method of turning a 3D object into a 2D object so it can be textured. A pdf of the tutorial is attached to the bottom of this post for offline reading.WARNING: Some images have automatically been resized by the board. Firefox users, right-click on the image and choose 'View Image'. I think IE users can just drag the image to the address bar at the top of the browser and when you release the mouse button, the image will appear in the window at full size. Then use the Back button to return to the tutorial. Don't know if there's an easier way for IE users.
Here's my example (yes, it's cheesy, but you get the idea!)Before you can complete this tutorial, you'll need to have the PolyMesh Editor (PME) plugin installed on AoI.
If you don't have the PME and you're not sure how to get it, check out this tutorial by marcc (http://www.friendlyskies.net/AoI/SPManager.swf
) The process is very simple, but I'm not going to cover it here as I've got enough to cover! You should also have a basic understanding of AoI and GIMP as I won't be covering every detail here.
I'm only learning how to do UV Mapping myself, so many of the steps I describe may contain errors or be inefficient. So, I'll apologize for that right up front. My goal is not to lead anyone astray, so please keep in mind that this is less than perfect. I recommend you check out these topics, as they've helped me immensely: Polymesh UnWrapping and UV Mapping in AoI Portal - written by the guy who's programming the AoI UV Mapping Feature
; Vidiot's Wink Video - UV Mapping a Cylinder
; Vidiot's Wink Video - Unwrapping Simple Cubes
The UV Mapping Function has developed quite a bit since those tutorials were made. But they're still excellent references to review.
The UV Mapping Function in AoI is relatively new and is a continual work in progess. Francois Guillet, the creator of the PME and the UV Mapper is constantly working on the plugin to add new feature, clean up bugs, and improve overall performance. If you run into problems with the program during this tutorial, I recommend you stop by the AoI forum (FriendlySkies Forum - Click Me!
) and ask for help.
I also won't be covering every menu option in the UV Mapping Tool. I just don't know how to use them all at this point. However, feel free to experiment with the options and see for yourself how they work.
Well, with all that out of the way, let's begin!Step 1
Click on the Create Polygonal Mesh Button
and while holding down the Shift key, click and drag with the left mouse button to create a cube in any of the view windows.
Next, double-click on the Name of the Polymesh you just created (in the Objects List) as shown below to open up the PME Window.
Here's where we unwrap the cube! I'm going to show you how unwrap the cube so that each individual face is a single unit. It's generally not the most efficient way of unwrapping, especially if you have an object with a LOT of faces. The reason is that you'll end up texturing a lot more individual surfaces and might not be able to make it look seamless, which is the goal of UV Mapping. However, I'll also show you a more convenient way to unwrap the cube so you can experiment. Francois and Vidiot both discuss the more convenient way to do it in their examples, so I will only show you where the seams should be and the unwrapped results.Step 2
In order to texture our object, we have to convert it from a 3D mesh to a 2D surface. To do that, we have to place seams on the model (seams are where the mesh will be opened). Seams are placed on edges, so click the 'E' button on your keyboard to get into Edge mode or click on the 'Edge' Button in the Mode Toolbar
Now, click Ctrl+A to select all the edges of your model.
Now, let's turn our selections into seams....
Go to Edge Menu > Mark Selection as Seams
and your selection should change color showing that the edges you selected have now been converted to seams, like so:
Remember that I said that seams are places where the mesh will be open? Well, the mesh in this case will be open on every edge, leaving us 6 individual faces to texture!Step 3
Let's unfold our mesh!
Go to Texture Menu > Unfold Mesh
The following dialog window will appear. Don't worry about the Advanced Button, just click on the Proceed Button to instruct the PME to unfold your mesh.
The PME will do its thing for a while and then, if all went well, the dialog window should look like so:
If your window looks like this, click the Continue button.Step 4
You'll now be in the UV Texture Coordinates Window and it should resemble this:
You may be thinking, "Fence, you said there were 6 faces, but you only show us one in the window." All 6 faces are there, they're just stacked on top of one another. Look in the upper right of this window and you'll see the faces there....piece 1, piece 2,....etc. Resize the individual windows as needed by clicking & dragging on the window dividers.
Next, Hold down the Ctrl key and drag up in the main window with the right
mouse button to give you some more room to work, as we're gonna place each face individually so we can export it to GIMP.Step 5
Now, highlight piece 1 in the upper right window to make it active and drag a window around the cube to select all the vertices (or use Ctrl+A), then you'll see a UV Universal Manipulator Tool (UMT) appear over the face and all of your vertices should be red to show they've been selected. Click on the little gray sphere in the middle of the UMT and move the first face to a new location, like so:
Select piece 2 and do the same thing and continue until your faces are spaced out like this:We're now ready to export this as an image so we can import it into GIMP to texure!Step 6
Click on the Edit Menu > Export Image
In the dialog window that appears, set a size and location where you want to save this image. It is recommended that you make your image size square.
Click the OK Button to accept these changes. Then click the OK button to close the UV Texture Coordinates Window and OK to close the PME. Keep AoI open, however!Step 7
Now, open up GIMP and Open the Texture you just exported from AoI....it should look like this:
Then paint each one of the faces....have fun with it. Also, if you don't want the black outlines of the faces showing on your finished product, make sure you paint over them....don't worry about going outside of the lines. You'll be able to tweak your vertices when we map the texture.
Here's my results.....
When you're satisfied with the results, save it in GIMP. I changed the name and extension in case I wanted to redo the texture later.
You can now close GIMP and go back into AoI.Step 8
Back in the Main AoI window, right-click on the Polymesh name and choose Set Texture
In the dialog window that appears click on the New Texture Button
and in the next dialog window, assign a name, choose Image Mapped (you could use a procedural texture, but we'll keep things simple here) and then click OK.
We want to assign our texture to the Diffuse Color. In the following dialog, click on the box next to the Diffuse Color area as highlighted below:
In the next dialog window, click on the Load Button and where you'll then be given the opportunity to locate the texture you just created in GIMP. Select that texture in the window and then click on the OK button to accept.
Now, you'll see the texture has been placed in the box next to the Diffuse Color. Adjust any of the other parameters as desired (I added a little bit of specularity so the texture is reflective) and then click the OK button to accept.Step 9
Next, we need to tell AoI how we want to map this texture. To do so, click on the Edit Mapping button as shown
In the Texture Mapping dialog, select UV from the Mapping dropdown menu and then click on the Edit UV Coordinates Button
A new dialog will appear where you have to choose
'Map Each Face Independently'. That is very important! Then, select OK.
Click OK to close the Texture Mapping Dialog
and OK to close the Object Texture Dialog
Now it's time to fit the texture to the mesh!Step 10
Double-click on the Polymesh name in the Objects List to enter the PME
In the PME Window, go to Texture Menu > Edit Mapping...
When the Window opens, you'll see your texture and the individual faces. They might not be lined up or you might see the texture appearing numerous times, as I've shown below. That's OK. As shown in my screenshot, go to Mapping Menu > Fit Mapping to Image Texture Size and things will line up a bit better.Before Fitting to Image Texture SizeAfter Fitting to Image Texture Size
Things aren't perfect, but here's where the fun begins!Step 11
Click on one of the pieces in the upper right window and then in the main window, select all the vertices of that piece by dragging a window around it or selecting Ctrl+A. When the UMT appears, move the piece over one of the texture blocks. You can use the UMT to scale the piece up or down by dragging on the handles. You can also select individual vertices and move them as needed. Experiment!
Here's a screenie showing one of the pieces being moved....
Here's a screenshot showing all of the faces mapped and what it looks like in the preview window. The preview window is a GREAT tool as it can help you align seams much better. Notice that the vertices you select in the main window are highlighted in the preview window. That's a very helpful feature as well.
Once you've got the mapping to your liking, click the OK button to close the UV Coordinate Window and then OK to close the PME.
Now you're ready to add some lights to your scene and any other objects and render away! Again, here's my result....
I said earlier in the tutorial that dividing up the cube in 6 individual faces is not always the most efficient way to work. Sometimes you want to work with as few pieces as possible. One way to do this for our cube is to create 7 seams, which will unfold the mesh in the shape of a cross.
Here's the screenshots showing you where to place the seams....Seam LocationsUnwrapped Mesh
Here's one way to unwrap a lumpy torus:
Create your torus with the Spline Mesh tool and convert it to a polygonal mesh. Open it up in the PME and select two edges as shown:
Next, hit Ctrl+L on the keyboard to select the Edge Loops as shown:
Then, unfold the mesh and this will be your result:
At this point, you would export the texture as before, paint it in GIMP, and apply it in AoI.
Well, I hoped this tutorial proved helpful! Have fun with it, make sure you show me your results, and let me know if you need any help or clarification. I'll do my best to answer your questions!