Wednesday, June 29, 2011

Notes 05

Animation in Maya
"S" key: create Keyframe
Animate -> Create Motion Trail: Maya will draw out the path of the animation, allowing us to see how it moves.
Hit "S" to create a key frame for that particular position.

Basic:
Just move the object (using one orthographic view is the best way) using the move tool. Then press the S key to create a key frame. If there are normal frames between two key frames (2-6), then Maya will move smoothly in a straight line from the position in the first keyframe to the position in the next keyframe.

However, sometimes not all object moves in such a straight line. In order to do our bouncing ball for example, we will have to create mutiple keyframes and manually position the object outselves in each frame. While easy to do and effective for simple objects, sometimes when it gets pretty complex, the amount of keyframes that we have can be so confusing and messy till it blows people's mind away. Therefore, we can use the advanced method instead.

Advanced:
Use graph editor to edit each individual attribute using a graph. The x-axis is the keyframe number while the y-axis is the value for the attribute. From here we can control the attributes individually with powerful features. We are no longer constrainted by a single straight line. We are able to use curves to smoothen and speed up/slow down at different parts of the time which makes the animation a whole lot better, and at the same time not needing so much keyframes to make the thing move.

Saturday, June 11, 2011

Assignment 1: Self Critique





(click pictures to see the enlarged version)

Some parts of the shape of the clock was a bit off if you compare the original real-world clock with the one I did in Maya. The circular shape for the LED screen was a bit too big. The back side of the clock is actually slanted, but my model in Maya looks pretty straight. The clock in the real world was also slightly fatter in depth and looks less round than in Maya. The model is okay otherwise, and in fact I liked how it turned out.

For the texturing, I am glad that most of the things went out fine. However, the text and the numbers on the LED screen was a bit slanted, which I had tried to fix it by trying to rotate the uv-map but it still looks slightly slanted (the original uv-map was worse, the numbers were extremely off without rotating the uv-map).

(click picture to see the enlarged version)

Also, for the sliders part, I felt that I should not use bump mapping for the spaces that the slider can move on, and doing a Boolean difference would be a possible alternative instead. This took some time to make it look right because the positions of the sliders were not indicated on the snapshot of the exported uv-map, so it take some time to draw the "pushed in" space for the slider and even then the space doesn't look straight enough.

(click picture to see the enlarged version)

Tuesday, June 7, 2011

Bumpyness & Giving It a Smooth and Natural Look

Step 5.2: Putting In Some Bump Maps
Now that we have some textures up, the final thing for getting the bonus is to put up some bump maps!

First... let us talk about the bump mapping techniques. What is bump mapping? It allows us to use lighting to create the details for the object. For example, bump mapping allows us to make a polygon looks like it has a lot of details, even though we only have one flat polygon down there. This is possible as the computer can use the bump map to cast different amount of lighting to different areas of the polygon. This gives the illusion that the thing is "bumpy" and detailed. The picture below shows bump mapping.

(click picture to see the enlarged version)

So how does it work? It is actually using another image to determine how much light to cast onto different areas of the surface. In the example above, the image below was used for the bump map texture.

Basically, the bump map uses different shades of gray to determine the "height" of the area. Completely white is the highest point in the bump map. The more dark the area is, the more "pushed in" it is. So if it is completely black, it is the deepest that the area can be "pushed in".


With the original texture as the base, I modified them to make my bump map for the clock and the sub-components, using the concept described above. Here is some result of creating the bump maps.


(click pictures to see the enlarged version)

Thus, there was not a need for me to do Boolean Difference to create the triangle for the battery cover, nor do Boolean Union to create the details for the slider. Saves polygons and also allows me to create and modify details easily instead of manipulating polygons!

Step 6: Smoothing the Object
The final step was to smooth the object. Right now, the clock model has sharp edges, which doesn't look very nice and is certainly not what our real-world object looks like. The sharpness looks too unnatural and therefore we have to find a way to smooth it.

There were two ways of solving this approach, however, picking either one of them has its own advantages and disadvantages. The picture below explains the scenario that I faced:

(click picture to see the enlarged version)

Eventually, I decided to have it "really" smoothed, because you can only see the bump maps in render mode and not when you draw the model, so I had to make sure that the object is smooth in render mode too. Thus I went ahead and press Mesh > Smooth.

However, this means that the clock now has 6112 polygons. But, I don't think it will matter since I am not using in a real game development project or anything, so this will do for now.

So this is the final product of all the work that I have done. The model for Assignment 1: complete!




(click pictures to see the enlarged version)

Touching Up: Putting Up the Textures

The shape outline is now complete, so what is left was to put up the textures

Step 5.1: Putting Up the Textures
This is perhaps the most tricky part because we only took one week to actually learn how to do texturing in Maya. However, I have read of these before so I am pretty confident in putting up the texture.

The first thing we have to do is to create the uv-map. I used automatic mapping, which is the same tool used during the texture creation for the cube. Although the clock is not a cube, but it has "six sides" like the cube, so it was good enough.

(click picture to see the enlarged version)


The parts are all over the place. So the first thing was to identify which faces belong to which side of the alarm clock.

(click picture to see the enlarged version)

Note: I know that the gray area was the only place where you are supposed to put the uv-maps for the faces, but I need some space to organize the faces.
Note 2: Other than the front faces, the faces for the other sides turned out to be alright and are together.

So I am left with the front faces, which for some reasons, are divided into several fragments.

So before I combine every sides to form one big uv map, I have to fix and combine the front side faces first. I could sew the edges one by one, but it takes quite some time, and the faces will get deformed as I combine more and more edges, which is bad. It also appears that you have to select all the correct edges before sewing, otherwise you will find that some edges are not sewed properly. So even though it looks like it is sewed, there are actually 2 edges.

Eventually, I settled on a method that I have found. I selected all the front faces (which will hide the other side faces in the uv editor), and choose Create UVs > Planar Mapping. I use Z axis for the Project from: settings. This basically lines up and arrange the uv mapping for the faces the same way it will appear as if I look at the front camera (the z axis way) in Maya.

(click picture to see the enlarged version)

This kept the shape and also keep the faces together. Fragment problem solved!

Next was connecting all the sides so that they eventually form one big uv map. This step is pretty optional, but as I do my texture later, I realized that the battery compartment overlaps into two sides, so I eventually decided to combine everything together.

In the process of combining the edges!
(click picture to see the enlarged version)

The uv-map is now complete, and the final uv-map is exported as a snapshot, into an image, which I then use my image editing software to start making my textures.


(click pictures to see the enlarged version)

There were very little issues with the uv-maps of the sub-components (i.e. the hr/min button, the snooze button and the sliders), because they were pretty simple objects and requires little modification. In fact, the hr/min button requires no modification to the uv-map because the default one was fine.

(click picture to see the enlarged version)

The last thing to worry about is the materials that are used for the clock. The clock reflects some light, so it won't really make sense to put everything in lambert. I created new blinn materials and put it onto the buttons and the clock itself.

For the LED display, there was slightly more light reflecting compared to the other parts of the outer cover of the clock. So it needs to have another material so that the light reflection can have a different value.

Originally I thought that the object itself can only have one material. But in reality, each individual faces can actually have its own material. The picture below illustrates the point, where I have blinn and lambert materials applied to the same object but to different faces, with different colours.

(click picture to see the enlarged version)

Using this same method, I manage to make the LED display of the clock more shiny compared to the outer cover of the clock.

The LED screen is now more shiny!
(click picture to see the enlarged version)

The texturing portion is done. Now the next step is to put in some bump mapping.

Saturday, June 4, 2011

Adding Our Sub-Components

So... we have our enhanced shape for our outer shell of the clock... but we are missing the buttons and sliders!

Step 3: Adding Our Sub-Components
Snooze/Light Button

The original plan for it is to use the Mesh > Create Polygon Tool, then trace out the outline of the Snooze/Light button, and at the end extrude the face so that it is not as thin as a paper and has actually some depth.

(click picture to see the enlarged version)

There is a problem with this approach as I discover later. The polygon is not made up of quads or triangle, but rather, is made up of one n-sided polygon! While this may seems minor, later I decided to bent the button to match to the shape of the clock.


But the bending is difficult to do because the polygons would then became deformed and the shape screws up.

The solution was to redo the button, but this time, instead of using the Create Polygon Tool, I would just use a  rectangular block with several subdivisions, and move the vertices around to make the same shape out. Now this time it is made up of several quads, instead of being made up of only one polygon.



The left side is the new one that is made up of several quads instead of just one piece of polygon on the right side. The right side is the old one that was originally made using Create Polygon Tool.

Now when we bend the button... it bends properly and smoothly without any screwed up shapes.


Hr/Min Button
The Hr/Min button was simply created with a sphere.

(click picture to see the enlarged version)

Sliders
The sliders were simply created with cylinders.

(click picture to see the enlarged version)

Earlier on in the plan, I have stated that I planned to create the slider by making two sphere along with the cylinder and Boolean Union them. However, there might be some issues in terms of topology with that method, and because I would like to use bump mapping instead to show that little detail on our slider, the spheres were omitted and only the cylinder was used.

With the sub-components created as specified in the plans, we finally have our complete shape of the clock. What is left to be done is in Step 4 and Step 5, which is to smooth the object and also create some textures (and bump maps) for the clock.

(click picture to see the enlarged version)