1.Model the polygon in Maya -...

22
Table of Contents 1.Model the polygon in Maya a. create an image plane b. start with a cube c. extrude faces d. divide the back face 2. Generate UVs in Maya a. planar UV Mapping and UV Texture Editor b. mapping the handle c. smooth the polygon 3. Draw Texture in Photoshop a. UV Snapshot b. working in Photoshop. c. linking to the photoshop file from Maya 4. Import into Unity a. import settings b. select textures and set materials c. adding colliders

Transcript of 1.Model the polygon in Maya -...

Page 1: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

Table of Contents

1.Model the polygon in Maya a. create an image plane b. start with a cube c. extrude faces d. divide the back face

2. Generate UVs in Maya a. planar UV Mapping and UV Texture Editor b. mapping the handle c. smooth the polygon

3. Draw Texture in Photoshop a. UV Snapshot b. working in Photoshop. c. linking to the photoshop file from Maya

4. Import into Unity a. import settings b. select textures and set materials c. adding colliders

Page 2: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

1. Model the hammer in Maya

a. Create an Image Plane

a1). Open Maya

a2). Click the four view layout button, indicated by the green arrow

a3). Click the attribute editor button, indicated by the yellow arrow. Your window should look pretty similar to the window pictured.

Page 3: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

a4).To load an image plane into the side view camera, click the “view” button in the side view camera indicated by the green arrow. Select “Image plane” > “Import im-age.”

a5). navigate to a side view image of a Hammer - like the file called “side view hammer.jpg.”

a6). the image plane node will appear in the attributeeditor - make sure that the but-ton “looking through camera” is clicked, so that the image plane is not visible in the perpective view

Page 4: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b. Start with a cube

b1). click the “cube” primitive button in the polygons tab, indicated by the green arrow.

b2). draw the cube anywhere on the grid.

b3). center the cube at 0,0,0 from the pCube1 tab in the attribute editor, indicated by the yellow arrow.

b4). set the dimensions of the cube to 10x10x10 from the polyCube1 tab in the attribute editor, indi-cated by the purple arrow

Page 5: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b5).Click the object selection button, indicated by the green arrow (toggle between the two modes with F8).

b6). Right click while your mouse is over the cube to bring up the component selec-tion menu, as shown above.

b7). select “face” from the menu.

b8). your cube will look like this when you are done:

b9). select the top face of the cube

Page 6: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

c. Extrude faces

c1). With the top face selected, click the “extrude poly face” button from the polygons tab, indicated by the purple arrow (or navigate to Edit Mesh > Extrude ).

c2). Click - Drag the arrows that appear at the center of the face to pull out the face. You can scale the faces by click-dragging on the colored cubes (red green and blue).

c3). continue this process until your model looks like the images below.

Page 7: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

d. Divide the back face

d1). select the polygon face of the geometry closest to the “claw,” indicated by the green arrow.

d2). navigate to the “Add divisions” window by clicking on the options box under Edit Meshes > Add Divisions, as indicated by the yellow arrow at left

d3). the dialog box to the left should show up. select “linearly,” and type in the value “2” for Divisions in U and the value “3” for Divisions in V. The result is shown below

Page 8: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

d4). continue modeling until the model looks like the one below. You can move indi-vidual vertices by right clicking on the model in object mode and selecting “vertex” from the component menu, as shown in the picture.

Page 9: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

2. Generate UVs in Mayaa. Planar Mapping

a1). navigate to Create UVs > Planar Mapping option box, as shown above. a2). from the resulting options dialog, select “bounding box,” and “x axis.” Click “Proj-ect.”

a3). open the UV Texture Editor from Window > UV Texture Editor

Page 10: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

a4). The UV Texture editor should show you something like this: as you can see, the hammer has been flattened along the x-axis.

a5). Now select the top faces of the hammer and select the “Create UVs > Planar Mapping” options box again.

a6). this time, select “y-axis” instead of x-axis, and the faces you have mapped will appear in the UV Texture editor. You can move these UVs independently of the other UVs

Page 11: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b. Mapping the Handleb1). Select the all faces of the hammer that constitute the handle except the bottom face. Now navigate to the “Create UVs” > “Cylindrical mapping” options box. Click “Project.”

b2). Using the methods described above, lay out the UVs of your model so that they occupy as much of the top right quadrant of the UV Texture editor as possible. Avoid overlapping shells.

Page 12: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

c1). Select the hammer in object select mode (it should be green), and navigate to the options box at Mesh > Smooth, indi-cated by the green arrow at right.

c2). The window to the right should ap-pear. select “Exponentially,” set “Division Levels” to 1, and preserve hard edges. Click “Smooth.”The Uvs will scale automatically

c3). After you’re done, smoothing the mesh, model the hammer so it looks like the image below.

c. Smooth the model

Page 13: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

a1). navigate to “Polygons” > “UV Snapshot...” from the UV TExture Editor.

a2). use the popup dialog to export an image. Make sure your image resolution is at least 2048x2048. You can now import this image into Photoshop, where you can texture the faces of the polygons with photographs and/or brushes.

3. Drawing the Texture in Photoshopa. UV Snapshot

Page 14: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b. working in Photoshopb1). after importing the UV Map into photoshop, use photographs and drawings to texture your hammer.

b2). try to be aware of seams so that the resulting texture is believable. Remember the “offset” filter. The UV mesh is editable in Maya. After you link your model to your tex-ture, you can move the points around to preview your texture in real time.

Page 15: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

c. link to the Photoshop file in Maya

c1). when you’re finished editing the photoshop document (you can always go back and re-edit it), open your UV mapped model in Maya and navi-gate to Rendering Editors > Hypershade.

c2). The Hypershade window is an interface for creating and managing materials in Maya. Select the “Lambert” material button from the menu on the left-hand side of the Hypershade window. A new material should appear in the Hypershade window

Page 16: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

c3). If you click on the new material, it will come up in the attribute editor as a tab. Click on the small checker pattern button next to “color,” indicated by the green arrow.

c4). The popup win-dow shown at left will prompt you to select a render node. Select “File,” and the window to the right will appear back in the attribute editor.

c5). click the folder icon next to “image name” in-dicated by the yellow arrow, and navigate to the texture you made in Photoshop.

Page 17: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

c6). Now go back to the hypershade, and middle click-drag the new material with the attached file onto your hammer in the perspective view. The cursor should turn into a little fist while dropping.

c7). You may open the UV Texture Editor and move the UVs individually until you are satisfied with the texture.

Page 18: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

4. Import into Unitya. import settings

a1). in a Unity Project, select Assets > Import New Asset...

a2). I imported theMaya file called “hammer.ma.” The asset that appears in the Project folder con-tains a mesh and comes with a Materials folder that includes the lambert material from Maya

a3). select the “hammer” mesh from the project window and turn on Calculate Normals and Split Tangents from the FBX Importer component. Set Smoothing to 180, and click “Apply.”

Page 19: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

a4). import the hammer texture with Assets > Import New Asset... Click on the hammer texture to view the import settings in the inspector. Set the maximum texture size to 2048 and click apply (assuming your texture is 2048x2048).

a5). click the material imported from Maya to view the material properties in the inspector. Select “specular” from the shaders drop down menu, and select the hamer texture from the texture expanding window indicated with the green arrow.

Page 20: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b. colliders. b1). drag the hammer asset into the scene tab. Create a directional light with GameObject > Create Other > Di-rectional Light.

b2).Create an empty game object with GameObject > Create Empty, and re-name the object “Hammer Parent.” Drag the hammer object in the scene onto the empty object named “Hammer Par-ent,” creating the hierarchy shown be-low

b3). Now create another empty game object named “HandleCollider” and par-ent HandleCollider to the HammerPar-ent Game Object.

Page 21: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b4). Click the “HandleCollider” object, and then click Component > Physics > Capsule Collider to add a Capsule Collider to the empty game object.

b5). adjust the settings on the capsule collider component to reflect the dimensions of the ham-mer’s handle.

b6). move the HandleCollider object so that the attached capsule collider matches the size and position of the Hammer’s handle.

Page 22: 1.Model the polygon in Maya - UCLAclasses.design.ucla.edu/Winter11/157B/wp-content/uploads/2011/01/... · 1.Model the polygon in Maya ... Import into Unity a. import settings ...

b7). Repeat this process until you get a set of shapes and a hierarchy like the one shown at right.

b8). Finally, create a prefab in your project folder with As-sets > Create > Prefab, and rename the prefab “Hammer-Parent.” Drag the “HammerParent” GameObject from the scene onto the “HammerParent” Prefab, and the prefab will store your model with colliders for instantiation, etc.