09mt202 graphics and animation lab manuel

Upload: ricky70s1

Post on 07-Apr-2018

235 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    1/24

    Ex No:1

    MAYA Interfaces

    Aim: The aim is to learn and practice various concepts of Polygon modeling.

    Software Used:MAYA 2008

    Procedure:

    Working in Maya

    Maya is the premier application for creating compelling 3D digital content,

    including models, animation, visual effects, games, and simulations.

    The work you do in Maya generally falls into these categories:

    Creating models. Polygons, NURBS, and subdivision surfaces are different

    object types with different ways of modeling. Each has its own strengths, anddifferent artists prefer working with different types.

    Bybuilding up and reshaping a number of simple surface facets you can

    create Polygons.

    You can easily create smooth, curving surfaces with high-level control by

    NURBS modeling.

    Subdivision surfaces let you edit surfaces at a high level with minimumoverhead data, while still letting you work with subsections of the surface as if

    they were made from polygons.

    Character rigging: Most animations involve characters, articulated modelssuch as a person, an animal, robot, or anything else that moves by articulation.

    Maya lets you define internal skeletons for characters and bind skin to them to

    create realistic movement with deformation.

    Animation: Just about everything you can think of in Maya is keyable or able

    to be animated.

    Dynamics, fluids, and other simulated effects: Maya includes acomprehensive suite of tools for simulating real world effects such as fire,

    explosions, fluids, hair and fur, the physics of colliding objects, and more.

    Painting and paint effects: Maya includes an incredible system for using a

    graphics tablet (or the mouse) to paint 2D canvases, paint directly on 3D

    models, paint to create geometry, scriptable paint, and virtually limitless otherpossibilities.

    Lighting, Shading, and Rendering: When you want to render a still image or

    movie of you scene or animation, you can create them using your choice of

    renderers.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    2/24

    Main window

    To show or hide any of the UI elements in the main window use the Display >

    UI Elements menu

    To hide a UI element, click the hide button to the left of or above the UI

    element. To show a UI element, press the right mouse button on another hide

    button and select the desired UI element from the pop-up menu.

    You can hide all the interface elements and instead use Mayas quickcommand features: the Hotbox, Marking Menus, and hotkeys.

    A menu icon appears to the right of the mouse pointer when a right mouse

    button pop-up menu is available for the control over which the mouse ishovering.

    3D coordinates

    The most basic visual entity is the point. The point has no size, but it has alocation. To determine the location of points, we first establish an arbitrary point in space

    as the origin. We can then say a points location is so many units left (or right) of the

    origin, so many units up (or down) from the origin, and so many units higher (or lower)

    than the origin.

    These three numbers give us the 3D coordinates of the point in space. For

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    3/24

    example, a point 7 units right (x), 4 units down (z), and 3 units above (y) the origin has

    the XYZ coordinates (7, 4, 3).

    To specify points on the opposite side of the origin, we use negative numbers. In

    the example, a point at (-5, -2, -1) would be 5 units leftof the origin, 2 units up, and 1unit below.

    Y-axis, X-axis and Z-axis

    In computer graphics, we dont really say the point is left/right, up/down, or

    higher/lower. Instead we call the three dimensions theX axis, theZ axis, and the Y axis.

    Y-up and Z-up

    In animation and visual effects, the tradition is to use Y as the up or elevation

    axis, with X and Z as the ground axes. However, some other industries traditionally use

    Z as the up axis and X and Y as the ground axes.

    Maya lets you switch the up axis between Y and Z. Select Windows >

    Settings/Preferences > Preferences, then click Settings in the list on the left.

    Objects and components

    In Maya, you model, animate, and render using objects such as spheres, NURBS

    surfaces, polysets, and so on. Objects are made up of or contain components, such ascontrol points, patches, polygon faces, and so on

    Selection, tools, and actions

    Selection

    When you select multiple objects, the last selected object is drawn in a differentcolor from other selected objects. This is known as the key object. Some tools use the key

    object to determine what to do with the selection. For example:

    When you transform multiple objects, the transformation uses the key objects pivotpoint.

    The constrain actions constrain all selected objects to the key object.

    Tools and actions:

    Maya makes a distinction between tools and actions.

    Tools work continuously: any clicks or drags you make in while the tool is active

    apply the tool. For example, the selection arrow is a tool. Any clicks or drags in theview window while the selection arrow is active perform a selection.

    Actions are immediate, one shot operations applied to the selection. Most items inthe menus are actions.

    Tools appear in the Tool Box. Almost all menu items are actions; however there are

    some tools in the menus. To tell which menu items are tool by the following:

    The menu item has the word Tool in it.

    When you select the tool it shows up in the Tool Box.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    4/24

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    5/24

    Click the tear-off line to tear off the menu. Click the Close button (x) to close the

    tear-off menu. Drag the window by the title bar to move it to a new location.

    Marking menus

    Marking menus are used throughout the Maya interface. When you right-click anobject, a marking menu appears that lets you select a selection mode and other options.

    Some marking menus appear when you hold a key and press a mouse button.

    Marking menus are very fast for experienced users because once you get used to

    showing them and the positions of their items, you can select the items using very quickgestures with the mouse or tablet pen, sometimes so fast the entire menu wont even

    display.

    Shelves

    Shelves hold commonly used actions and tools, allowing them to be accessed byclicking an icon. You can also put custom scripts and panel layouts on a shelf.

    Work with menu items, tools, and options

    To use a tool

    Click a tool in the Tool Box to make it active.

    Double-click a tool to show the Tool Settings panel.

    Use an action (menu item)

    Click a menu item to perform the action on the selected objects or components.

    Some actions work differently depending on the order you select the objects. For

    example, you select all the objects you want to constrain, and then select the object to

    constrain to last when you create a constraint.

    The help line for an action tells you the order you need to select objects if order isimportant.

    Click the _ box next to the name of a menu item to open the actions optionswindow.

    Click the lines at the top of a menu or submenu to keep the menu open in its ownwindow.

    Select actions from marking menus

    Marking menus appear at the mouse pointer when you use certain key and mouse button

    combinations. They allow you to quickly select an action from a small list.

    Marking menus are common in the Maya interface:

    When you press the right mouse button on an object Maya shows a context-sensitivemarking menu of actions you can apply to the object.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    6/24

    The hotbox provides five customizable marking menus you can show by clicking

    inside, above, below, left, or right of the hotbox menus.

    You can assign marking menus to hotkeys. Hold the key and press the mouse button

    to show the marking menu.

    The q, w, e, and r keys have default marking menus attached to them.

    Marking menu items can show additional marking menus, allowing you to pack

    more commands onto the marking menu.

    To select an item from a marking menu

    Show the marking menu through one of the methods listed above (forexample, hold q and press the left mouse button).

    With the mouse button held, drag in the direction of the item you want toselect.

    Dragging over an item with a submenu attached shows the submenu.

    Release the mouse button to select the item.

    Select actions from the hotbox

    The hotbox contains every action available in the Maya interface. It appears when

    you hold down the space bar.

    The hotbox has three main functions:

    It contains every menu and menu item. This is useful if you want to quickly use an

    action from another menu set without switching menu sets.

    You can use the hotbox to select actions even if youve hidden the menu bar and

    other UI to save space.The hotbox provides five customizable marking menus you can show by clickinginside, above, below, left, or right of the hotbox menus.

    To select an action from the hotbox

    Hold the space bar to show the hotbox. The hotbox remains on screen as longas you hold the space bar.

    Click one of the menus, or hold the left mouse button above, below, to the

    left, to the right, or in the center of the hotbox to show marking menus.

    Result:

    Various tools and functions of MAYA interfaces have been learnt and practiced

    successfully.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    7/24

    Ex No: 2

    Polygon Modeling

    Aim: The aim is to learn and practice various concepts of Polygon modeling.

    Software Used:MAYA 2008

    Procedure:

    Polygons are a type of geometry use to create three-dimensional models Maya.The other geometry types that Maya provides for modeling in 3D are NURBS and

    subdivision surfaces.

    There are a variety of techniques you can use to create 3D polygonal models in Maya:

    Primitives are three-dimensional geometric shapes you can create in Maya. Theprimitive shapes available include spheres, cubes, cylinders, cones, planes, and

    many others. You can modify the attributes of basic primitives to make them

    more or less complex. You can also split, extrude, merge, or delete the variouscomponents on the primitives polygon mesh in order to modify the primitives

    shape. Many 3D modelers begin with polygon primitives as a basic starting point

    for their models. This technique is referred to asprimitive-up modeling.

    Individual polygons can be created using the Create Polygon Tool. This tool lets

    you place individual vertices in the scene view to define the shape of anindividual polygon face. You can then split or extrude the polygon face to create

    additional polygon faces that are attached to the first one and build your polygonmesh in that fashion. This Create Polygon Tool technique can be useful when you

    need to closely match a particular shape or outline. For example, if you needed to

    model a particular 3D logotype for an animated logo sequence or trace the outlineof a 2D image using a bitmap image imported onto an image plane as a reference.

    Polygons can also be created by converting an existing NURBS or subdivision

    surface models using the Convert features found under the Modify menu

    Polygon terminology

    Polygons are straight-sided shapes (3 or more sides), defined by three-

    dimensional points (vertices) and the straight lines that connect them (edges). The interior

    region of the polygon is called the face. Vertices, edges, and faces are the basiccomponents of polygons. You select and modify polygons using these basic components.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    8/24

    When you model with polygons you usually use three-sided polygons calledtriangles or four-sided polygons called quadrilaterals (quads). Maya also supports the

    creation of polygons with more than four sides but they are not as commonly used formodeling.

    An individual polygon is commonly called a face, and is defined as the area

    bounded by three or more vertices and their associated edges. When many faces are

    connected together they create a network of faces called apolygon mesh (also referred toas apolysetor apolygonal object).

    3D polygonal models are created using polygon meshes. Polygon meshes can be

    created using a variety of techniques.

    Polygon meshes normally share the vertices and edges that are common between

    the individual faces. These are referred to asshared vertices orshared edges.

    A polygon mesh can also be composed of several disjointed sets of connected

    polygons calledshells. The outside edges of a mesh or shell are referred to as borderedges.

    Result:

    Various concepts of polygon modeling have been learnt and practiced

    successfully.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    9/24

    Ex No: 3 (a)

    NURBS Modeling

    Aim:

    The aim is to learn and practice various concepts of NURBS modeling.

    Software Used:

    MAYA 2008

    Procedure:

    NURBS (Non-Uniform Rational B-Splines) are one geometry type you can use to

    create 3D curves and surfaces in Maya. The other geometry types that Maya provides arepolygon and subdivision surfaces.

    Non-Uniform refers to theparameterization of the curve. Non-Uniform curves

    allow, among other things, the presence of multi-knots, which are needed torepresent Bezier curves.

    Rational refers to the underlying mathematical representation. This propertyallows NURBS to represent exact conics (such as parabolic curves, circles,

    and ellipses) in addition to free-form curves.

    B-splines are piecewise polynomial curves (splines) that have a parametric

    representation.

    NURBS are useful for constructing many types of organic 3D forms because ofthe smooth and minimal nature of the curves they use to construct surfaces. NURBS

    surface types are widely used in the fields of animation, games, scientific visualization,

    and industrial design.

    Overview NURBS modeling

    To use NURBS in Maya you can do one of the following:

    Construct 3D models using NURBS primitives.

    Primitives are simple 3D objects created in the shape of common geometric forms

    such as cubes, spheres, cones, and so on. Primitives can be a great starting point formany 3D shapes. You can modify the attributes of NURBS primitives to modify their

    shape.

    You can also modify NURBS primitives by trimming away portions of their

    forms, beveling their edges, or by sculpting them into different shapes using the Maya

    Artisan sculpting tools. NURBS Modeling 10 1 | NURBS overview About > Themathematics behind NURBS

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    10/24

    Construct NURBS curves that define the basic outline of the 3D form you

    wish to construct and then use the curves as a basis for constructing yourNURBS surfaces.

    Maya provides several options for constructing and modifying NURBS curvesand surfaces:

    You can draw curves by placing control vertices, or edit points. Thecurve drawing tools are found in the Create menu.

    The features for editing NURBS curves are used by first selecting the

    Surfaces menu set, and then selecting the desired curve editing feature

    from theEdit Curves menu.

    The features for creating NURBS surfaces are used by first selecting

    the Surfaces menu set, and then selecting the desired surface creationfeature from the Surfaces menu set.

    The features for modifying NURBS surfaces are used by first selecting

    the Surfaces menu set, and then selecting the desired surface editing

    feature from theEdit NURBSmenu set.

    Subdivision surfaces

    Subdivision surfaces are a unique surface type available for modeling in Mayathat possess characteristics of both polygon and NURBS surface types.

    Like NURBS surfaces, subdivision surfaces are capable of producing smooth

    organic forms and can be shaped using relatively few control vertices.

    Like polygon surfaces, subdivision surfaces allow you to extrude specific areas

    and create detail in your surfaces when it is required. This is accomplished by having the

    ability to work at different component levels of detail on the subdivision surface. You canswitch between the different levels of detail as often as necessary.

    A single subdivision surface can have different levels of detail in different

    regions. That is, a region that has a complex shape can have more control points to allowfiner detail, while a simple or flat region will have fewer control points.

    Subdivision Surface Level = 0Subdivision Surface Level = 1Subdivision Surface

    Level = 2Subdivision Surface Level = 3

    Modeling with subdivision surfaces is an easy way to create intricate objects such

    as human hands. It combines the best features of NURBS and polygonal modeling.

    You can convert existing NURBS and polygon surface types to subdivisionsurfaces and vice versa.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    11/24

    Working of subdivision surfaces

    Subdivision surfaces get their name from their characteristic dividing into

    regions of greater detail. You start with a base mesh and divide and subdivide regions

    into finer and finer detail, with each subdivision giving greater control in that area.

    You reshape subdivision surfaces by modifying control points at the differentlevels of the hierarchy. The base mesh (or level 0 mesh) allows you to reshape large

    areas of the overall surface. The subdivided levels allow finer control in specific regions

    of the surface.

    Advantages of subdivision surfaces

    Subdivision surfaces allow higher level control over shape than polygons.

    They allow you to only use complex geometry in the complex regions of yourmodel.

    They allow creases (sharp edges) and arbitrary topology (not just four-sided

    sheets). The continuity of subdivision surfaces eliminates many of the problems that

    can occur at seams when you animate NURBS surfaces.

    You can bind subdivision surfaces to skeletons at a coarse level and the

    effects will translate smoothly to the finer levels.

    Result:

    Various types of NURBS modeling have been learnt and practiced successfully.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    12/24

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    13/24

    Ex No: 4

    Lighting

    Aim:

    The aim is to learn and practice various types of lighting techniques available in

    Maya.

    Software Used:

    MAYA 2008

    Procedure:

    Light and shadow in the real world

    In the real world, when light shines on a surface, the parts of the surface facingtoward the light source appear illuminated, and the parts of the surface facing away from

    the light source appear dark. If one object is located between a second object and the light

    source, the first object casts a shadow onto the second object.

    Absorption, reflection, and refraction of light

    The color of the objects we see in the natural world is a result of the way objectsinteract with light. When a light wave strikes an object, it can be absorbed, reflected, or

    refracted by the object. All objects have a degree of reflection and absorption.

    Diffuse, Specular, and Glossy reflection

    Reflection is divided into three types: diffuse, specular, and glossy.

    Diffuse reflection.

    Diffuse surfaces reflect (scatter) light in many angles.

    Diffuse reflection accounts for more of the color than any other type of distribution

    because most objects are opaque and reflect light diffusely.

    Glossy reflection:

    Glossy surfaces are actually specular surfaces with micro surfaces at angles tosurface plane. These micro surfaces reflect light not only specularly but also diffusely (at

    angles very close to the specular transmission), giving the surface a glossy appearance.

    There are six light types in Maya: ambient , area , directional , point , spot , and volume .

    You can combine these light types to produce just about any lighting scenario. A Mayascene may use one or all of the above light types, depending on the mood and art

    direction of the scene.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    14/24

    Ambient light produces a uniform light throughout the scene. You should keep

    this type of light to a minimum, because the more you use it, the flatter and more

    devoid of contrast the scene will appear.

    Directional light produces parallel light rays that wash light across the scene in

    one specific direction.

    Point light radiates light out from its center in all directions. The farther an objectis from this light, the less it is illuminated.

    Spot light, lights an area within a cone shape. The light comes from the center

    point and travels in a specified direction.

    Area light is two-dimensional, rectangular light source that emits light from theentire rectangle in the direction of the line perpendicular to the rectangle.

    Volume light, lights an area within a user -defined volume. Examples of volume

    light include light around a lit candle or torch.

    Result:

    Various types of lighting techniques have been learnt and practiced successfully.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    15/24

    Ex No: 5

    Dynamics

    Aim:

    The aim is to learn and practice various tools in dynamics.

    Software Used:

    MAYA 2008

    Procedure:

    Dynamics is a branch of physics that describes how objects move. Dynamic

    animation uses rules of physics to simulate natural forces. You specify the actions youwant the object to take, then let the software figure out how to animate the object.

    Dynamic animation lets you create realistic motion thats hard to achieve with

    traditional key frame animation. For instance, you can make effects such as tumbling

    dice, waving flags, and exploding fireworks.

    There are two types of objects in maya dynamics:

    a) Soft Bodies

    These are objects that have flexible skin and can change shape if hit with a force

    or another object. The software creates this body by changing the shape into particles. Itis the different particles that will be affected by forces and will cause the shape tochange. For each frame, the software will connect all of the dots and construct the shape.

    b) Rigid Bodies

    Rigid bodies will not be changed. There are 2 different types of rigid bodies:

    passive rigid bodies and active rigid bodies. Passive bodies can influence active ones,though they cannot be influenced or changed by other bodies. The active bodies can be

    influenced by other rigid bodies as well as interactions. Active bodies cannot be

    controlled by the user but passive bodies can be controlled through all of the key frames.

    Fields

    Fields are localized or global forces that act on objects. You can simulate themotion of natural forces with dynamics fields. Fields have their own icons in a scene, so

    it's easier to select them if you want to animate a field or change its attributes. These

    fields are included with Maya.

    Stand-alone fields influence objects from a stationary or moving position in theworkspace. It's not owned by geometry.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    16/24

    Object Field are owned by an object and exert influence from the object. You can add

    fields to polygons, NURBS curves or surfaces, particle objects, lattices or curves on the

    surface.

    Volume Fields: You can select a volume to define the region in space in which particles

    are affected.

    The following fields are included with Maya:

    Air: An air field simulates the effects of moving air. The objects you connect to

    the air field accelerate or decelerate so their velocities match that of the air as theanimation plays. A "push" type of field, it comes with presets for Wind, Wake,

    and Fan.

    Drag: A field that slows the momentum over time of objects within its reach. A

    drag field exerts a friction or braking force on an object that's animated with

    dynamic motion.

    Gravity: The most commonly used field, it causes objects to move and acceleratein a given direction. You can limit its reach to create localized gravity fields. It

    simulates the Earth's gravitational force.

    Newton: Similar to gravity, but operates in a spherical manner. A newton field

    pulls object towards it. Objects are attracted to Newton fields more strongly

    depending on their mass and their distance from the Newton field.

    Radial: A radial field pushes objects away or pulls them toward itself, like amagnet. Like the Newton field, but it doesn't take mass into account. It can be set

    to diminish with distance, as with the Gravity and Air fields, and it can be set topush or pull.

    Turbulence: Makes the object's motion or deformations more random.

    Turbulence is usually applied to soft bodies or particles to create the impressionof wind or waves.

    Uniform: A field that pushes objects in a specified direction. Like the Gravity

    field, but without the progressive acceleration that Gravity includes.

    Vortex: A kind of rotating gravity, the Vortex field pulls objects in a spiraling

    motion that's centered on the field's icon. Often used to create galaxies,whirlpools, or tornados with particle systems.

    Volume Axis: A complex field that lets you specify a volume shape (cube,sphere, cylinder, cone, or torus) and then create effects that work within the

    shape. You can use the Volume axis field to create effects such as particles

    flowing around obstacles, solar flares, mushroom clouds, explosions, tornadoes,

    and rocket exhaust.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    17/24

    Constraints

    There are several different types of constraints, though these can only be applied

    to rigid bodies. A nail constraint will set a point in which the body will rotate. The lengthfrom this spot and the object is fixed. A pin constraint is used for 2 bodies. This will

    create a rigid rod between the 2 bodies. Think of this like creating a mobile with differentobjects at the base. A spring constraint will use a pivot point though the distance from the

    point to this object can contract and stretch. A hinge constraint uses an axis through theobject. The axis is fixed and the object can rotate around the hinge.

    Complex Shapes

    It is possible to approximate complex shapes using simple geometry. By first

    creating the simple geometry and then creating a dynamic situation, it is possible to havethe more complex objects inherit the dynamic interactions. This is advantageous for

    setting up scenes. To ensure that all fields do not change when transformed, make sure

    that the transformations are frozen. All of the fields and dynamic motions can be tweakeduntil the desired animation is achieved. Many times, adding more mass to the bodies and

    rotating them will create realistic motion.

    Key frame

    Once all the motion has been completed, then this motion can be baked into the

    key frames. This translates all the motion into the key frames and works well instead ofhaving to calculate motion. Once the baking has occurred, then key frames cannot be

    affected by any dynamics.

    Result:

    Various tools of dynamics have been learnt and practiced successfully.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    18/24

    Ex No: 6

    Animation in Maya

    Aim:

    The aim is to learn and practice different types of animation in Maya.

    Software Used:

    MAYA 2008

    Procedure:

    Maya animation provides you with the powerful tools you need to bring thecharacters and objects in your scenes to life. These tools give you the freedom to animate

    any attribute of an object and the control you need to successfully transform joints and

    bones, IK handles, and models over time.

    In this guide, you can find information on the various animation types in Maya:

    Key frame animation lets you transform objects or skeletons over time bysetting key frames. For example, you can key frame the joints and IK

    handles of a characters arm to create an animation of its arm waving.

    Driven key animation lets you link and drive the attributes of one objectwith those of another object by setting driven keys. For example, you can

    key a characters X and Z translations as Driver attributes and a door

    models Y rotation as the Driven attribute to create an animation of acharacter and a swinging door.

    Nonlinear animation lets you split, duplicate, and blend animation clips toachieve the motion effects that you want. For example, you can use

    nonlinear animation to create a looping walk cycle for one of your

    characters.

    Path animation lets you set a curve as an animation path for an object.

    When you attach an object to a motion path, it follows the curve during its

    animation. For example, when you assign a car model to a motion paththat follows a road in your scene, the car follows the road when you play

    the animation.

    Motion capture animation lets you use imported motion capture data to

    apply realistic motion to the characters in your scene. For example, you

    can use the captured motion of a horse to animate the skeleton of aquadruped model.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    19/24

    Dynamic animation lets you create realistic motion by using the rules of

    physics to simulate natural forces. For example, you can use MayaDynamics to create effects such as sparks spraying from a welding torch

    or hail falling from the sky.

    Expressions are instructions that you can type to animate attributes. Forexample, you can write an expression formula that animates the flapping

    of a birds wings.

    Controlling animation

    With Mayas animation controls, you can key objects, manage your scenes

    timeline, and play back animation.

    Previewing animation

    When you work on an animation, you will want to preview the playback at aspeed close to final production speed. To save time while previewing, you need to

    balance the quality of graphics with playback performance. You can also turn on displayoptions, such as ghosting and motion trail, to help you visualize the flow of a characters

    motion.

    Playing back animation

    Ideally, you should be able to click the Play forwards button and your animation

    would play back full-screen, fully shaded, and in real-time without dropping any frames.Although this is possible with smaller animations, the more complex a scene is, the more

    computations required before displaying each frame. You can customize that playback ofyour animation by setting the Timeline, Playback, Animation, and Sound preferences. Toedit these options, go to the Playback options in Window > Settings/Preferences >

    Preferences. Motion Trails

    With Motion Trail, you can display the trajectory of an object. Motion Trails

    works with objects that are animated by key frame animation, deformers, motion capture,

    and expressions. You can create the motion trail before you animate an object or after.

    Play blasting animation

    The Play blast window lets you preview an animation quickly by performing ascreen grab of the view at each frame then blasting the resulting images to the specified

    image viewer. The images can be saved either as a movie file or as a sequence of images

    in various formats.

    Result:

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    20/24

    The various types of animation has been learnt and practiced successfully.

    Ex. No.07

    Implementations in Java 2D.Lines and pixel graphics

    Aim:To write a program using java2D to generate pixel graphics and lines.

    Software required:

    Java development kit (jdk-7-windows-i586).

    Files to be imported:

    a) java.awt.Color;

    b) java.awt.Dimension;

    c) java.awt.Graphics;

    d) java.awt.Graphics2D;

    e) java.awt.Insets;

    f) javax.swing.JPanel;

    g) javax.swing.JFrame;

    h) java.util.Random;

    i) java.awt.geom.Line2D

    Procedure:

    1. Open a new text document.

    2. Create a folder named java in C directory ( c:\java).

    3. Type the required program in the text document.

    4. Save the file with extension .java and change the save as type to ALL FILES.

    5. Run the command prompt by typing cmd in Start-> Run.

    6. Mention the current directory which also includes the folder name where we havesaved the program (e.g. cd c:\ java ).

    7. Compile the program by typing javac .java.

    8. Run the program by typing java .

    Result :

    Pixel graphics and lines were created successfully using java2D.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    21/24

    Ex.No.08

    Drawing arbitrary curve

    Aim:

    To write a program using java2D to draw arbitrary curves.

    Software required:

    Java development kit (jdk-7-windows-i586).

    Files to be imported:

    a) java.awt.Graphics;b) java.awt.Graphics2D;c) java.awt.geom.Line2D

    Procedure:

    1. Open a new text document.

    2. Create a folder named java in C directory ( c:\java).

    3. Type the required program in the text document.

    4. Save the file with extension .java and change the save as type to ALL FILES.

    5. Run the command prompt by typing cmd in Start-> Run.

    6. Mention the current directory which also includes the folder name where we have

    saved the program (e.g. cd c:\ java ).

    7. Compile the program by typing javac .java.

    8. Run the program by typing java .

    Result:

    Arbitrary curves were created successfully using java2D.

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    22/24

    Ex. No 09

    Projections in Java 3D

    Aim:To write a program using java3D to create projections.

    Software required:

    Java 3D (j3d-1_5_2-windows-i586).

    Procedure:

    1. Open a new text document.

    2. Create a folder named java in C directory ( c:\java).

    3. Type the required program in the text document.

    4. Save the file with extension .java and change the save as type to ALL FILES.

    5. Run the command prompt by typing cmd in Start-> Run.

    6. Mention the current directory which also includes the folder name where we have

    saved the program (e.g. cd c:\ java ).

    7. Compile the program by typing javac .java.

    8. Run the program by typing java .

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    23/24

    Result:

    Projections were created successfully using java3D.

    Ex No- 10

    Textures in Java 3D

    Aim:

    To write a program using java3D to create textures.

    Software required:

    Java 3D (j3d-1_5_2-windows-i586).

    Files to be imported:

    1. import com.sun.j3d.utils.geometry.*;

    2. import com.sun.j3d.utils.universe.*;

    3. import com.sun.j3d.utils.image.*;

    4. import javax.media.j3d.*;

    5. import javax.vecmath.*;

    6. import java.awt.Container;

    Demo code:

    1. TextureLoader loader = new TextureLoader("stripe.jpg", this);

    2. ImageComponent2D image = loader.getImage();

    3. Texture2D texture = new Texture2D();

    4. texture.setImage(0, image);

    5. Appearance appear = new Appearance();

    6. appear.setTexture(texture);

    Procedure:

  • 8/3/2019 09mt202 Graphics and Animation Lab Manuel

    24/24

    1. Open a new text document.

    2. Create a folder named java in C directory ( c:\java).

    3. Type the required program in the text document.

    4. Save the file with extension .java and change the save as type to ALL FILES.

    5. Run the command prompt by typing cmd in Start-> Run.

    6. Mention the current directory which also includes the folder name where we have

    saved the program (e.g. cd c:\ java ).

    7. Compile the program by typing javac .java.

    8. Run the program by typing java .

    Result:

    Textures were created successfully using java3D.

    Ex No -11 Drawing points and polygons with open GL