Swardson Studios

Production and Training


Posts Tagged ‘ 3D ’

Rigging in computer graphics (aka. puppet setup or animation setup) is the process by which complex animation units are given simpler higher level controls in order to make the process of animating faster, better and easier. The goal for a setup artist is to provide a rig to the animator that allows them to spend more time refining the shot the way they want it rather than fiddling with a faulty rig that limits what they can do. There are a zillion methods to solve an array of problems but there are some basic bulidng blocks we must establish before one can delve into the process of rigging.

This video is 1 of a set of 5 videos that will introduce the most basic tools and concepts available in Maya to start you off on a good grounding for creating some amazing and effective rigs.

lets get started shall we!

1. Proper Scene Organization

Get the Flash Player to see this player.

uvcrapstableIn this tutorial I am going to walk you through the process of laying out the UV’s and texturing a craps table. Yes this is a follow-up to our previous tutorial where we textured a simple and high resolution die. I thought it would be appropriate to link the tutorials so you can use them together in a scene.

This tutorial will be directed more as a step by step process of laying out the UV’s of our craps table. This is by no means the only way to do this, but just like everything else in Maya there are hundreds of ways to do the same thing. I am going to use different tools and toolsets to do this to give you a well rounded experience with the different tools you have available to you. In future projects you will be able to use what you learn here and adapt it for what you need.

So PAY ATTENTION to what you are doing! Don’t just follow it step by step and then forget what you have done.It will help in the future, I promise.

So, we have received our model from the modeler. How do we go about texturing it? Well, the first step should be gathering reference. Whether that is photos, diagrams, the actual object, the more you can get the better. Unfortunately we don’t have a craps table, so we will have to resort to Google for the images.

Here are some for you to familiarize yourself with them.

So, looking at these images we can get a descent idea of how things need to be laid out. We are going to need a material for the felt table, a light reddish wood material for the main outer and inner rim of the table, a leather texture and a darker wood texture for the underside and the legs.

Our goal here is not to re-create this specific craps table, but using it as a guide we can get a good idea of how to texture our table to look good.

For this tutorial we have some milestones we need to hit in order to call this project complete.

Here they are:

  1. Acquire our model
  2. Layout our models UV’s while assigning texture maps.
  3. Render our final textured model.
Lets get started shall we!

First we need to Acquire our model.

  1. 1. Download crapsTable.zip and save it to your maya projects directory
  2. 2. Unzip/Extract the crapsTable.zip file so that you have the crapsTable project folder in your maya projects directory.
  3. 3. Open maya and go to file> Project> Set
    • Navigate to your maya projects directory and choose the crapsTable project.
  4. 4. Go to file>Open Scene and choose the crapsTable.ma file
  5. 5. Once the file is opened you should see the craps table model sitting on the grid. See image below.

Take this time to familiarize yourself with the model. Rotate around it, zoom in, select the various objects in the scene and check out the topology.

Open the outliner and see what things are named.

Notice the layers on the bottom right, turn them on and off to see how its laid out.

Everything is laid out and named and split apart to make the texturing process easier. Any good modeler will do this for you, however, you may get a solid model and have to split it up yourself. Taking a look at your reference imagery you may want to split your model up your model so the areas with different textures are separate.

Next take a look at the UV’s for the model. (Select the top level group, and open the UV Texture editor).

Yuuuuuuuuuuucccccckkkkkkk!!!!!

I know what you are thinking. This is horrible!

Now do you believe me when I told you that the UV’s can get nasty when you have been just focusing on modeling your object?

Milestone ‘A’ has been reached! We have our model. Let’s recap and see what we need to do next.

  1. Acquire our model
  2. Layout our models UV’s while assigning texture maps.
  3. Render our final textured model.

Milestone B is to Layout our models UV’s so that we can go about texturing this thing in a successful manner.

uvdiceIn this tutorial I am going to walk you through an introduction to laying out your models UV’s for use in applying texture maps to your model that do more than simply make it red, blue, yellow, desert sand bug, or a checker board. Yes! I know you are shocked! What more could you possibly need then a shaders color channel and checker a board texture? Not much, but after hours of searching I finally found something that needed something more. :-)

A die.

No, nothing about death you morbid people. A single die, like dice but only 1 of them :-)

In this tutorial we will go through introductory steps as to how to apply a single file texture (tif image file) to our model in order to change it from a simple cube into a die.

For those of you sheltered individuals who have never seen a die before, here is an image of a couple.

diceImage

You will notice that each of the sides of the die in the image has successive dots going from 1 to 6. In order to properly create our die we need our dots to be on the correct sides.

1 dot is opposite of 6, 2 is opposite of 5, and 3 is opposite of 4.

For this tutorial we have some milestones we need to hit in order to call this project complete.

Here they are:

  1. Acquire our model
  2. Acquire and assign our texture map
  3. Layout our models UV’s.
  4. Render our final textured model.
Lets get started shall we!

First we need to Acquire our model.

  1. 1. Download simpleDie.zip and save it to your maya projects directory
  2. 2. Unzip/Extract the simpleDice.zip file so that you have the simpleDie project folder in your maya projects directory.
  3. 3. Open maya and go to file> Project> Set
    • Navigate to your maya projects directory and choose the simpleDie project.
  4. 4. Go to file>Open Scene and choose the simpleDie.ma file
  5. 5. Once the file is opened you should see a simple polygon cube sitting on the grid. See image below.

picture1

I have wireframe on shaded turned on for this tutorial. If your file does not look like mine do the following:

In your panel view go to Shading and choose ‘Wireframe on Shaded’ to toggle it on and off.

We are going to spending an equal amount of time during this tutorial between our perspective view and our UV texture editing window. To open this window go to your Main Menu Bar > Window > UV Texture Editor. See image below.

Picture 2

There are a number of tools and options built into this window, some of which we will utilize in this tutorial while others we will not. I highly recommend you read up on the remaining tools and experiment with their uses on your own at another time to familiarize yourself with the full scope of UV mapping tools Maya has to offer.

Milestone ‘A’ has been reached! We have our model. Let’s recap and see what we need to do next.

  1. Acquire our model
  2. Acquire and assign our texture map
  3. Layout our models UV’s
  4. Render our final textured model

Milestone B is to acquire our texture map. However, before we do that, lets look further at our model and its UV’s to determine what they look like and where we need to go next.

latlongxyzWith the help of some initial work from a friend of mine and some research online I have implemented a way to accurately place objects on a sphere using latitude and longitude coordinates. However, we are not simply rotating the object with its pivot point at the center of the
sphere. We are actually converting the longitude and latitude coordinates to XYZ coordinates on the fly.

First, let me explain what Latitude and Longitude actually are. To explain this I will use the most logical subject, the Earth. We all know what the equator is… or at least I hope so. The equator is the line that divides the Earth’s northern hemisphere from its southern hemisphere. Remember this term. The second term needed to discuss Latitude/Longitude is the Prime Meridian. The Prime Meridian is the line that divides the Earth’s Eastern hemisphere from it’s Western hemisphere. While the equator is a natural defining division of the
Earth based on its rotation, the Prime Meridian is an arbitrary line that passes through Greenwhich, England and each of the Earth’s poles. The complimentary line to the Prime Meridian is the International Date Line which is on the opposite side of the Earth.

To start the description, Latitude describes the angle along the equator from the Prime Meridian. In fact the Prime Meridian defines 0
degrees Latitude. Longitude describes the angle along the Prime Meridian from the Equator. In fact, the Equator defines 0 degrees
Longitude. So, a Longitude and Latitude of 35, 106 describes 35 degrees off the Equator and 106 degrees off the Prime Meridian.

In computer graphics we often define objects in space by X, Y and Z coordinates based on the origin of 0, 0, 0. It makes sense then to want to get different coordinate systems into X, Y and Z rather than trying to define X, Y and Z into other systems. So how do we do that? Well, it’s all about trigonometry in this situation.

Here is the equation.

1
2
3
tx = radiusOfSphere * cos(latitude) * cos(longitude);
ty = radiusOfSphere * -sin(latitude);
tz = radiusOfSphere * cos(latitude) * sin(longitude);

I won’t go into why this works because it is kind of drawn out. If you want to know, Google it and you should find many mathematical papers describing this.

The only thing about this equation that is tricky is that it returns values in radians rather than degrees. Again, if you want to know the
difference, Google it.

So lets set it up in Maya.

Create the Earth geometry as a nurbs or poly sphere in Maya with a specific radius (say 25, and yes, I know the Earth isn’t a true sphere, but the difference is so small, we simply omit it for purposes of art and simplicity).

After applying the earth color texture map to the sphere you will need to rotate the sphere by 90 degrees in Y to get the texture lined
up with where it needs to be (don’t worry to much about this, just do it).

Create the object you want to place at a specific lat/long on the Earth. Add 3 custom float attributes to it.

latitude (controls the latitude of the object)
longitude (controls the longitude of the object)
altitude (controls the distance from the object’s center to the sphere’s surface, think of a radius offset)

Then create the following expression and apply it (notice the deg_to_rad function that converts the latitude and longitude degrees into radians before being calculated).

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
float $radius = 25; //radius of the sphere or Earths surface in Maya</code>
 
float $altitude = $radius + pSphere1.alt; // distance from center of earth to center of object.
 
float $long = deg_to_rad(pSphere1.long)*-1; //longitude value in radians
 
float $lat = deg_to_rad(pSphere1.lat)*-1; //latitude value in radians
 
// the equation to do the conversion and placement.
 
pSphere1.translateX = $altitude * cos($lat) * cos($long);
 
pSphere1.translateY = $altitude * sin($lat) * -1;
 
pSphere1.translateZ = $altitude * cos($lat) * sin($long)

Once applied to your object (a poly sphere in my case) will be placed on the Earth in the correct position at your given altitude.

**Special thanks to Adam Kugler for pointing out a discrepancy with the code. Thanks for the tip!

Try setting some keys on the attributes and see the object travel along the surface of the Earth.