Return to Black Sierra Mod.com

It is currently Mon Sep 06, 2010 10:06 pm

All times are UTC - 5 hours [ DST ]





Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Maya - Modeling and UVing Cylinder Objects - Intermediate
PostPosted: Tue Jul 14, 2009 12:25 pm 
Art Director
User avatar

Joined: Sun Apr 13, 2008 1:29 pm
Posts: 281
Location: Pennsylvania, United States
Offline
Note: This tutorial may be for those just starting out, but it automatically assumes that you know how to use the basics of your program. This includes camera rotation, moving, and zooming, along with how to create an object, and navigate the menus.

When you first start modeling, it might come to mind that making a cylinder shaped object, such as a pipe, would be an easy to make static, that could be used in almost every map and doesn’t’ require much time to model. After all, modeling programs already come with pre-defined cylinder shapes. However; as soon as you start modeling you find out that you get a lot of seam issues. It’s very noticeable, and makes it look bad. Then on top of that, a pipe is long, and it makes it hard to texture a good looking pipe because it always looks stretched out because it is so long.


Well here is a step-by-step tutorial on creating cylinder style objects more easily.


Let’s start with the basics, so just incase no one knows. I’m making my objects to be imported into the Unreal Tournament 3 engine, which is the Unreal 3 Engine that comes packaged with the game. So first off, I decided to make myself some concrete wire. This stuff goes in the middle of cement, and as the cement dries it bonds to the this thick metal wire and reinforces things a LOT. If any one has ever tried to make a rather big stepping stone out of pure cement without this stuff, they’ll know it cracks a lot easier, in fact. I’ve had it crumble before in my hands as I’ve picked one up. However; ignoring all that. It’s just a generally good way to add litter, or decay to your environment easily.


Image

It is always good to have multiple images of what you’re making. But this gives you an example of what it looks like. So let’s start with the basic modeling. Create a cylinder in Maya or your respective program. For Maya, go to Create > Polygon Primitives > Cylinder Options (Click on the square next to the name)


Image

This will bring us up a new option box, generally we want it to have about 8 divisions around, this isn’t going to be an object that’s looked at a lot. So it doesn’t need to be super round, but we want to make our game look pretty at the same time. So I’m gonna go the extra few divisions just to keep it from looking too poor. I have mine in the Z axis, it’s smart to keep all your objects oriented in the same way, that way when you get into more complex things, like weapons and people you know which way they’ll spawn in-game, rather than having to rotate them a million times with code. You can usually just take the last rotation if you need and apply it to all.

Image

Here we have created our cylinder, I used vertices (hold down right mouse button over top of your object > release over top Vertices), selected all the dots(vertices) on the one side, and then held down X on the keyboard (note: If caps lock is on, hotkeys are different) and used the mouse to drag only the Z (blue) Axis (arrow that moves things) to the edge of the grid (the…grid).

Now if you notice, the cylinder has rough lines around it. This isn’t because we didn’t add enough divisions to make it smoother, it’s because Maya has an option to turn edges into either Hard or Soft edges (Also known as smoothing groups in some programs like 3DS Max). What this does is gives it either a hard/soft look to make things such as sharp corners stick out more. Now they are hard by default, but we want them soft.

Image

So hold down the right mouse button over top of our cylinder, and release over “edges”. Select all the edges in the middle, go to Normals > Soften Edge. Make sure you don’t select any of the edges at either end of the cylinder. If you do you’ll get weird shadowing issues, and it’ll look all mushy. Now deselect the object (hold right mouse button over the object > Release on Object Mode > Click somewhere on the Grid), and you’ll notice it looks a lot more round, and pretty. This is good, we want that.


So now we know we want this crazy grid style cement mesh/wire layout. So it generally looks like a pound sign (#) or tic-tac-toe if you prefer. But instead of modeling it all, then having to UV every single wire it is easier and more efficient to model one wire, then duplicate it and rotate it. It’s small enough of a model that it doesn’t need unique wires, most of the time it’ll just be wires sticking out of the wall or floor anyways so you won’t pay a whole lot of attention to it.


Now we want these wires generally long, but if we do that the UV will stretch and we’ll have a bad looking object. So instead of modeling an entire wire, we’re going to model HALF of it, UV it, then duplicate and reverse the object to make the other half (the rest of the wire) to make it one long wire. So let’s UV this part first.

Image

Go into your side view, and select only half of the model. Either the top half, or the bottom, it doesn’t matter. Now g, to Create UV > Planar Mapping Option Box (the square next to the name) We want to be projecting off of the X axis, and to keep Height/Width ratio. The rest is default.

Image

Image

Now let’s get into our UV-Editor window. Click on Windows > UV Texture Editor.

Now if you’ve never used the UV Texture Editor before, it’s basically just like a Maya 2D Front View. You move around using the camera hot-keys and the mouse like any other view. You can hold down the right mouse button to get your selection types, and you use your hot-keys for Translation (W) Rotation (E) and Scale (R).

If your UVs disappear, chances are you don’t have your object selected in one of the four modeling views. So, to make life a little easier on us. Close your UV Texture Editor, now go to one of your four views, and you’ll see Panels > Layouts > Two Panels Side by Side. This splits our four screens into two.


Image

Image

Now make one window your UV Texture Editor, and the other your Perspective view. This is an easy way to UV, as it allows us to not only switch to a full sized UV Texture Editor a lot faster (just put your cursor over your screen, and tap space bar. Tap again to go back to your multiple screens), but it also allows us to easily do quick selections in our perspective view in order to UV faster in general.


So now, make sure your object is selected in the Perspective (Persp) view and then in the UV Editor view, hold down the right mouse button and select UVs You’ll notice that on your Perspective view, instead of having Purple dots like you do when you select vertices, you get this brownish color. So in the UV Editor view, highlight the ends of your recently mapped UV edges. In order to select BOTH sides, you need to select one side normally, then hold down the SHIFT key on the keyboard as you select the other. This allows you to cue up more selections, also; notice how your brown dots turn green when selected. Make sure to hit W on the keyboard if you don’t see your translation axis (colored arrows)

Image

Now that we are selected, we want to drag these UVs off to the left side to get them out of the way of any new UVs being created, or any old ones left behind. After you drag them off, you can select the scale tool with the R on the keyboard and then scale it up using the green square and dragging up. This gives us an easier view of everything since it isn’t all scrunched up now.

Now this is where our handy Persp view comes into play a bit more. Now that you expanded them in the Y (green) direction we have room to move things, but there is a very important thing we must remember about UVing (especially for cylinders). We need to have even spacing for each face. So in UV mode, highlight only a row (both sides) and with the X key on the keyboard held down, drag with the Y axis (green) only. Holding down X is called “Grid Snapping”. This will snap the UVs onto one of the grid lines, so it is important not to have any other axis’s selected or else you’ll combine them side ways too, causing our UV to be messed up. Now using our Perspective view, we can make sure that we’re stacking them correctly. The middle UVs on the entire object, go on the bottom (shown in the picture) then the other go onto the grid line above that, with the very tip of the cylinder on the top most gridline of the three. Make sure each UV line gets the same amount of squares. This keeps things even.

Image

Now that we have our spacing down, we need to do the bottom half. So let’s select Faces in our Perspective view and then select the bottom three faces. Do the same thing UVing wise, create a planar map in the X axis. Go into your UV Texture Editor and go into UV selection mode (hold down right mouse button) and select both ends, then move it to the left, and down. Right under the previous UV is fine, stretch it up. Then snap each UV Edge to a grid line with even spacing.

Image

Now the entire reason we UVed the two halves separately, is because it allows us to move the two halves around easier. Because what we want to do is actually over-lap our UVs. This allows us to create a seamless texture because the middles meet. But there are two ways to do this. If you need more UV space (because we’re limited if you didn’t know) we can have the bottom half, be in the completely same spot as the top half, which allows us to texture the ENTIRE wire only using HALF the wire. For this instance, we’re simple going to connect the middles and texture the entire cylinder. So in your UV Editor view, go into Edge selection mode (hold down right mouse). Now hold down your left mouse button, and make a small selection square over the top edge of your bottom cylinder. The reason for this, is that when you click and hold the mouse button, you can select groups of things, but we’re only selecting one edge. However; there is an EDGE hidden behind each edge, because this is a cylinder in 2D view, so we need to make sure to grab both sides. You’ll also notice, that when you select the edge, the top half has an edge selected too. That’s because they’re both the same edge, which is why we’re connecting them, to avoid seams. You can also select edges in Perspective view, and they’ll be selected in the UV view if it makes it easier.


Image


Now in your UV editor view you can see in the top left a bunch of unique menus. Click on Polygons > Move and Sew UV edge, what this does is sort of “welds” together both edges into one as well as moves them closer together (you can use Sew UV Edge also, which only connects the edges, it doesn’t move the rest of the UV connected to them).

If you used the Move and Sew option rather than just Sew, you will see that our UV is now connected and still evenly spaced. If your UVs are all over the place after sewing, it means that you have flipped faces, and requires a little bit of a complex fix that would take up a bit chunk of this tutorial, so I won’t be getting into it right now.



So now we need to rotate our UV to go straight up and down rather than side to side, this will allow us to have a shorter width in our texture which is better performance, so in UV mode highlight all of your UVs (click and drag over the entire UV) and go back to Polygons > Rotate Option Box (square). Set your rotation to 90 degrees, and hit apply. This will flip everything you have selected 90 degrees, if you have lines stretching out randomly after this, it usually means you didn’t select EVERYTHING and something didn’t get rotated. Now it’s a good time to make sure everything is aligned. D this by taking each UV edge and snapping it to the grid again (hold down X on the keyboard) using the proper translation (in our case, should be the X (red) translation) along with the top and bottom’s translation (Y (green) translation). After we do this, scale the entire thing (R) down a little, we don’t want the UV being on the very edge of the grid, or else it’ll be hard to texture.

Image

Now we should have a pretty similar layout at this stage. We’re pretty much done UVing, we just need to take those ends and combine them together to save space, so in UV mode in the UV editor, highlight one, and translate it in the Y direction until you get pretty much a perfect overlay. No sewing edges, that won’t work here. Now if you’ve never UVed before, the ENTIRE UV has to be in that shaded area of the UV editor’s grid. I know there is four squares, which is nice to lay everything out with. But you have to scale everything you do into that shaded area. That’s just sorta how it works. So let’s do that, move it all around in UV mode to fit in that shaded area. Try to use as much of the shaded area as possible, but stay proportionate when it comes to faces or else you’ll probably have stretching. So this is how mine turned out



Image




Now in your Perspective View, make suer to deselect your object, then select it in object mode. If you are set into UV/Edge/Faces/Vertex mode, it won’t export the UV into a texture file. So that is sorta a problem.

Go back to your UV Editor, and go to Polygon > UV Snap Shot way at the bottom.

Click on Browse, and find yourself an area where you can find your UV. Unfortunately you have to set this path every time you do this. Now in Size X (Width) put 512, and Size Y (Height) put 1024. If you have “Keep Aspect ratio” checked, it will automatically keep adjusting the opposite axis (X or Y) to match, so make sure that’s unchecked. And then set your Image Format to Targa. It’s a decent file type to use. Hit ok. If all went well, it exported it.

Image

This tutorial doesn't cover texturing due to the complex nature of it, that it requires a seperate tutorial. So this is how my texture came out, it’s pretty basic but it works. I was having a few stretching issues, so all I had to do was squeeze the UV into it’s self slightly, so it wasn’t so wide. Now in my case, I can actually make the texture 256 wide as it’s a simple texture. But it’s not required, it just helps performance.
Image

So now we have our texture done, we want to make this wire/rod longer. So first we need to move our pivot, if you don’t know what a pivot is. It’s where the object translates, rotates, and scales from. Very useful for a lot of things. For example, if you set the pivot to the end of an object, and rotate it, it will rotate from the end, rather than the middle of the object and swing it around. So anyways; to do this, press INSERT on your keyboard, you now have control of your pivot. This looks almost exactly like the translate/move axis, except it has no arrows. To move it easily, hold down the V key, and middle mouse and drag over the very middle of one of the ends. Holding V down snaps it just like holding down X, except it snaps it to Vertices, instead of the grid, herei s the area I snapped mine to.

Image

Go back into translate mode (just hit W on your keyboard) so you don’t mess up your pivot. Now go into Edit > Duplicate Special option box.

Image

Now if you haven’t used Duplicate Special before, it’s basically a way to create multiple copies in various positions, rotations, and scales. For example, if you wanted to create 3 more of the same exact object, each time getting 3 times bigger than the last, you use this window. Set all your scales to 3.0, and it will scale it up 3 times more than the previous. Same with rotate, want to make a fan? Well set the pivot correctly, and rotate it by say 30 degrees, and create 3 of them and it’ll rotate all three in a circle.


However; it also has another use, make sure everything is reset to default Edit > Reset to Default and then go down to scale. Now you’ll see three boxes, these are our axis, and they’re in alphabetical order. X is box 1, Y box 2 and Z box 3. We want Z, so box 3 of scale. Type -1.0, what this is going to do is mirror the entire object in the Z direction, making the same exact rod we had before at the end of the last one (remember, it duplicates based off of the pivot place). Now what this did for us, was took the rod and made it longer without stretching the UV. Because it’s exactly using the same exact UV as the old rod, this also allows for the texture to merge perfectly allowing there to be no seam, which is the entire point of this tutorial, allowing us to create cylinders without seams.


Now, select them both and hit Mesh > Combine


Image

Now hit 4 on your keyboard to go into Wireframe mode, hold down the right mouse button and hit Faces, select the faces that connect the two and hit your delete key. This keeps the model clean, as those faces will be rendered, but never seen. Now hit 6 to go back to texture mode.

Now we are almost done. Go back to object mode. Select our entire object which is now one. And duplicate it (Ctrl + D/Edit > Duplicate) (make sure not to do SPECIAL. Just normal duplicate) and move our cylinders around into the shape we want. Here is the finished version of mine.

Image

Now here we are, completely done. Now I can do what I want with them, I can add some more lines through them and bend them, remove some, etc in order to give them a destroyed look, make a few single ones to go inside walls and etc.


Small reminder: If you don’t know how to get your view back to normal, on the left hand side. You’ll have all your tools, below that you’ll see a bunch of weird square icons, you should notice one looks like your 4-view perspective. Click that, that’ll give you 4 squares again. Persp, Side, Top and Front.

_________________
Image
Officially full of BS.


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme Created by HOLLYSMOKE