0% found this document useful (0 votes)
22 views

New Lab CGAM - Spring 2022

The document discusses computer graphics concepts like drawing lines, changing line colors, drawing pixels, drawing shapes like triangles and polygons, filling shapes with different colors, drawing arcs, ellipses, circles, round rectangles, and translating shapes. It provides source code examples and output for each concept. It also lists some tasks like drawing stairs, names, shapes, and translating a rectangle.

Uploaded by

Aliza Azhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

New Lab CGAM - Spring 2022

The document discusses computer graphics concepts like drawing lines, changing line colors, drawing pixels, drawing shapes like triangles and polygons, filling shapes with different colors, drawing arcs, ellipses, circles, round rectangles, and translating shapes. It provides source code examples and output for each concept. It also lists some tasks like drawing stairs, names, shapes, and translating a rectangle.

Uploaded by

Aliza Azhar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 59

Computer Graphics Animation & Multimedia SSUET/QR/114

Lab #1
Objective:
Demonstrate Visual C++ Computer Graphics basic function and implementing line
command and boundary coloring
Theory :

 Computer Graphics:
Using a computer as a rendering tool for the generation (from models) and manipulation
of images, more precisely: image synthesis

How to Draw a line.

Source Code:

void CLineView::OnDraw(CDC* pDC)


{
pDC->MoveTo(10, 22);
pDC->LineTo(155, 64);
}

Output:

How to Change the color of line:

Source Code:
void CLinecoView::OnDraw(CDC* pDC)
{

pDC->MoveTo(10, 22);
pDC->LineTo(155, 64);
CPen penGreen(PS_SOLID, 5, RGB(0,255,0));
CPen* pOldPen=NULL;
pOldPen=pDC->SelectObject(&penGreen);

Computer Engineering Department 1


Computer Graphics Animation & Multimedia SSUET/QR/114

pDC->MoveTo(10, 22);
pDC->LineTo(155, 64);
pDC->SelectObject(pOldPen);
}

Output:

Q3. Draw a line by putting pixel on screen.

Source Code:
void CPixView::OnDraw(CDC* pDC)
{

pDC->MoveTo(30, 150);
pDC->LineTo(300, 80);
pDC->SetPixel(200, 300, RGB(0,0,0));

Output:

Lab Tasks:

1. Draw Stairs using with MoveTo and LineTo command.


2. Draw your Name using with MoveTo and LineTo command.

Computer Engineering Department 2


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab #2
Objective :

Apply Simple Visual C++ Graphic Functions like polygon drawing and color filling

Theory :
It is used to create any shape with more than two points (Polygon,Triangle etc).
 CRect (Create Rectangle):
It is used to create any four sided shape (Rectangle, Square etc).
 FillRect (Fill Rectangle):
It is use for solid fill the required shape like Rectangle, Square.
 CPen (Create Pen):
It is use to modify or change the boundary color of any shape.
 CBrush (Create (Brush) :
It is use for solid fill in any shape.

How to draw a triangle with the help of Polygon Function & then fill it
(Yellow color).

Source Code:
void CTrianView::OnDraw(CDC* pDC)
{

CBrush BrushYellow(RGB(250, 255,


5)); CBrush *pBrush;

CPoint Pt[3];
Pt[0] = CPoint(125, 10);
Pt[1] = CPoint( 95, 70);
Pt[2] = CPoint(155, 70);

pBrush = pDC->SelectObject(&BrushYellow);
pDC->Polygon(Pt, 3);

pDC->SelectObject(pBrush);

Output:

Computer Engineering Department 3


Computer Graphics Animation & Multimedia SSUET/QR/114

How to draw a 7-sided polygon & then fill it (Red color) by using CBrush.

Source Code:
void CPolyView::OnDraw(CDC* pDC)
{
CPoint Pt [7];
Pt[0] = CPoint(20, 50);
Pt[1] = CPoint(180, 50);
Pt[2] = CPoint(180, 20);
Pt[3] = CPoint(230, 70);
Pt[4] = CPoint(180, 120);
Pt[5] = CPoint(180, 90);
Pt[6] = CPoint(20, 90);

pDC->Polygon (Pt, 7);


//fill it with red color
Students Task
}

Output:

Lab Tasks:

1. Draw a Four triangle with the help of Polygon Function & then fill it by
using CBrush.

2. Draw a 3-Sided polygon with CPoint and then fill it with Green color.

Computer Engineering Department 4


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab #3
Objective :
Apply Simple Visual C++ Graphic Functions like Arc, Ellipse, Circle, RoundRect, CRect
and FillRect Commands

Theory :

 Arcs:
An arc is a portion or segment of an ellipse, meaning an arc is a non- complete
ellipse. Because an arc must confirm to the shape of an ellipse, it is defined as it
fits in a rectangle and can be illustrated as follows:

Syntax is:
Arc(int x1, int y1, int x2, int y2,int x3, int y3, int x4, int y4);
Besides the left (x1, y1) and the right (x2, y2) borders of the rectangle in which the
arc would fit, an arc must specify where it starts and where it ends. These
additional points are set as the (x3, y3) and (x4, y4) points of the figure. Based on
this, the above arc can be illustrated as follows:

Computer Engineering Department 5


Computer Graphics Animation & Multimedia SSUET/QR/114

How to draw an ARC


Source Code:
void CArcView::OnDraw(CDC* pDC)
}

pDC->Arc(20, 20, 226, 144, 202, 115, 105, 32);

Output:

 Ellipses and Circles

An ellipse is a closed continuous line whose points are positioned so that two
points exactly opposite each other have the exact same distant from a central point.
It can be illustrated as follows:

Because an ellipse can fit in a rectangle, in C++ programming, an ellipse is defined


with regards to a rectangle it would fit in. Therefore, to draw an ellipse, you
specify its rectangular corners. The syntax used to do this is:
Ellipse(int x1, int y1, int x2, int y2);
The arguments of this method play the same roll as those of the Rectangle()
method:

Computer Engineering Department 6


Computer Graphics Animation & Multimedia SSUET/QR/114

How to draw an ELLIPSE


Source Code:
void CEllipView::OnDraw(CDC* pDC)

}
pDC->Ellipse(20, 20, 226, 144);
}

 Round Rectangles

A rectangle qualifies as round if its corners do not form straight angles but
rounded corners. It can be illustrated as follows:

To draw such a rectangle, you can use the CDC::RoundRect() method. Its
syntaxes are:
RoundRect(int x1, int y1, int x2, int y2, int x3, int y3);

When this member function executes, the rectangle is drawn from the (x1, y1) to
the (x2, y2) points. The corners are rounded by an ellipse whose width would be x 3
and the ellipse's height would be x3.

Computer Engineering Department 7


Computer Graphics Animation & Multimedia SSUET/QR/114

How to draw an ROUNDRECTANGLE


Source Code:
void CRRectView::OnDraw(CDC* pDC)
}
pDC->RoundRect(20, 20, 275, 188, 42, 38);
}
Output:

 FillRect:
This method fills a specified rectangle using the specified brush. The method fills
the complete rectangle, including the left and top borders, but it does not fill the
right and bottom borders.

How to fill color in the rectangle by using Brush and Fillrect

Source Code:

void FillRect (LPCRECT lpRect, CBrush* pBrush);


}
CBrush brSYell(RGB(255, 255, 150));
CBrush* pOldBrush=NULL;
pOldBrush=pDC-
>SelectObject(&brSYell); CRect r(10, 50,
100, 150);
pDC->FillRect(r, &brSYell);
pDC->SelectObject(pOldBrush);
}
Output:

Lab Tasks:
1. Draw two Rectangle of same size and fill them with you our choice.
2. Draw a circle by using Arc and Circle Commands:
pDC->Arc
pDC->Ellipse

3. Draw a House.
Computer Engineering Department 8
Computer Graphics Animation & Multimedia SSUET/QR/114

Lab # 4
Objective:
Implement 2D Transformation Translation Function with drawRect( )

Theory:
What is Translation?

 In a translation transformation all the points in the object are moved in a straight line
in the same direction. The size, the shape and the orientation of the image are the
same as that of the original object. Same orientation means that the object and image
are facing the same direction.
 A translation moves an object to a different position on the screen. You can translate
a point in 2D by adding translation coordinate (t x, ty) to the original coordinate (X,
Y) to get the new coordinate (X’, Y’).

 Relation:
 From the above figure, you can write that −
X’ = X + tx

Y’ = Y + ty

 In Matrix:

P = , P’ =

T=

P’ = P + T

Computer Engineering Department 9


Computer Graphics Animation & Multimedia SSUET/QR/114

How to Draw a rectangle & translate it by a factor of 50.

Source Code:

TranslateView.h

// Operations
public:

int x[4], y[4];


int xN[4], yN[4];

// Implementation
public:

virtual ~CTranslateView();
void drawRect(int x[4 ], int y[4], CDC*);
void translate(int xN[4], int yN[4], int x[4],int y[4], int x1,int y1);

TranslateView.cpp

void CTranslateView::OnDraw(CDC* pDC)

{
CTranslateDoc* pDoc = GetDocument();

x[0]=200;
y[0]=100;
x[1]=200;
y[1]=30;
x[2]=270;
y[2]=30;
x[3]=270;
y[3]=100;

drawRect(x,y, pDC);
translate(xN, yN, x, y, 50,50);
drawRect(xN,yN, pDC);

pDC->MoveTo(x[0],y[0]);
pDC->LineTo(x[1], y[1]);
pDC->MoveTo(x[1],y[1]);
pDC->LineTo(x[2], y[2]);
pDC->MoveTo(x[2],y[2]);
pDC->LineTo(x[3], y[3]);
pDC->MoveTo(x[3],y[3]);
pDC->LineTo(x[0], y[0]);
}

Computer Engineering Department 10


Computer Graphics Animation & Multimedia SSUET/QR/114

void CTranslateView::translate(int xN[4], int yN[4], int x[4], int y[4], int x1,int y1)

{
xN[0]=x[0]+x1;
xN[1]=x[1]+x1;
xN[2]=x[2]+x1;
xN[3]=x[3]+x1;
yN[0]=y[0]+y1;
yN[1]=y[1]+y1;
yN[2]=y[2]+y1;
yN[3]=y[3]+y1;
}

void CTranslateView::drawRect(int x[4 ], int y[4], CDC *pDC)

{
pDC->MoveTo(x[0],y[0]);
pDC->LineTo(x[1], y[1]);
pDC->MoveTo(x[1],y[1]);
pDC->LineTo(x[2], y[2]);
pDC->MoveTo(x[2],y[2]);
pDC->LineTo(x[3], y[3]);
pDC->MoveTo(x[3],y[3]);
pDC->LineTo(x[0], y[0]);
}

Output:

Lab Task:

1. Draw a triangle and then translate it by a factor of 50 and color their boundary

Computer Engineering Department 11


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab # 5
Objective:

Implement 2D Transformation Rotation Function with drawRect()

Theory:

What is Rotation?

In rotation, we rotate the object at particular angle θ (theta) from its origin. From the
following figure, we can see that the point P(X, Y) is located at angle φ from the
horizontal X coordinate with distance r from the origin.

Let us suppose you want to rotate it at the angle θ. After rotating it to a new location,
you will get a new point P’ (X’, Y’).

Using standard trigonometric the original coordinate of point P(X, Y) can be


represented as −

X=rcosϕ.....(1)

Y=rsinϕ.....(2)

Same way we can represent the point P’ (X’, Y’) as −

x′=rcos(ϕ+θ)=rcosϕcosθ−rsinϕsinθ..........(3)

y′=rsin(ϕ+θ)=rcosϕsinθ+rsinϕcosθ..........(4)

Substituting equation (1) & (2) in (3) & (4) respectively, we will get

′=xcosθ−ysinθ

′=xsinθ+ycosθ

Computer Engineering Department 12


Computer Graphics Animation & Multimedia SSUET/QR/114

Implement the given code to perform rotation on rectangle.

Source Code:

RotateView.h

// Operations
public:
int x[4], y[4];
int xN[4], yN[4];
float theta;
// Implementation
public:
virtual ~CRotateView();
void drawRect(int x[4 ], int y[4], CDC*);
void RotateObject(int [4],int [4], int [4], int [4], double Angle);

RotateView.cpp

void CRotateView::OnDraw(CDC* pDC)


{
CRotateDoc* pDoc = GetDocument();
x[0]=200;
y[0]=100;
x[1]=200;
y[1]=30;
x[2]=270;
y[2]=30;
x[3]=270;
y[3]=100;
drawRect(x,y, pDC);
RotateObject( xN, yN, x, y, 30.0);
drawRect(xN,yN, pDC);
RotateObject( xN, yN, x, y, 45.0);
drawRect(xN,yN, pDC);
RotateObject( xN, yN, x, y, 120.0);
drawRect(xN,yN, pDC);
pDC->MoveTo(x[0],y[0]);
pDC->LineTo(x[1], y[1]);
pDC->MoveTo(x[1],y[1]);
pDC->LineTo(x[2], y[2]);
pDC->MoveTo(x[2],y[2]);
pDC->LineTo(x[3], y[3]);
pDC->MoveTo(x[3],y[3]);
pDC->LineTo(x[0], y[0]);
}

void CRotateView::RotateObject(int xN[4],int yN[4], int x[4], int y[4], double


Angle)
{
Angle= (Angle*3.14)/180;

Computer Engineering Department 13


Computer Graphics Animation & Multimedia SSUET/QR/114

xN[0]=x[0]*cos(Angle) - y[0]* sin(Angle);


yN[0]=x[0] * sin(Angle) + y[0] *cos(Angle);
xN[1]=x[1]*cos(Angle) - y[1]* sin(Angle);
yN[1]=x[1] * sin(Angle) + y[1] *cos(Angle);
xN[2]=x[2]*cos(Angle) - y[2]* sin(Angle);
yN[2]=x[2] * sin(Angle) + y[2] *cos(Angle);
xN[3]=x[3]*cos(Angle) - y[3]* sin(Angle);
yN[3]=x[3] * sin(Angle) + y[3] *cos(Angle);
}

void CRotateView::drawRect(int x[4 ], int y[4], CDC *pDC)


{
pDC->MoveTo(x[0],y[0]);
pDC->LineTo(x[1], y[1]);
pDC->MoveTo(x[1],y[1]);
pDC->LineTo(x[2], y[2]);
pDC->MoveTo(x[2],y[2]);
pDC->LineTo(x[3], y[3]);
pDC->MoveTo(x[3],y[3]);
pDC->LineTo(x[0], y[0]);
}

Output:

Lab Tasks:

1. Draw a Round Rectangle and then rotate it by different angles. and


color their boundary.
2. Draw a triangle and then rotate it by different angles. and color their
boundary.

Computer Engineering Department 14


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab # 6
Objective:
Implement 2D Transformation Scaling Function with drawRect()

Theory:

What is Scaling?

To change the size of an object, scaling transformation is used. In the scaling


process, you either expand or compress the dimensions of the object. Scaling can be
achieved by multiplying the original coordinates of the object with the scaling factor
to get the desired result.

Let us assume that the original coordinates are (X, Y), the scaling factors are (S X,
SY), and the produced coordinates are (X’, Y’). This can be mathematically
represented as shown below −

X' = X . SX and Y' = Y . SY

The scaling factor SX, SY scales the object in X and Y direction respectively. The
above equations can also be represented in matrix form as below −

(X′Y′)=(XY)[Sx00Sy]
Where S is the scaling matrix. The scaling process is shown in the following figure.

If we provide values less than 1 to the scaling factor S, then we can reduce the size
of the object. If we provide values greater than 1, then we can increase the size of
the object.

Computer Engineering Department 15


Computer Graphics Animation & Multimedia SSUET/QR/114

Draw a rectangle & then scale it by a factor of 3.

Source Code:
ScaleView.h

// Operations
public:
int x[4], y[4];
int xN[4], yN[4];
// Implementation
public:
virtual ~CScaleView();
void drawRect(int x[4 ], int y[4], CDC*);
void scaling(int xN[4], int yN[4], int x[4], int y[4], int sx, int sy);

ScaleView.cpp

void CScaleView::OnDraw(CDC* pDC)


{
CScaleDoc* pDoc = GetDocument();

x[0]=200;
y[0]=100;
x[1]=200;
y[1]=30;
x[2]=270;
y[2]=30;
x[3]=270;
y[3]=100;
drawRect(x,y, pDC);
scaling(xN, yN, x, y, 3, 3);
drawRect(xN,yN, pDC);
pDC->MoveTo(x[0],y[0]);
pDC->LineTo(x[1], y[1]);
pDC->MoveTo(x[1],y[1]);
pDC->LineTo(x[2], y[2]);
pDC->MoveTo(x[2],y[2]);
pDC->LineTo(x[3], y[3]);
pDC->MoveTo(x[3],y[3]);
pDC->LineTo(x[0], y[0]);

void CScaleView::scaling(int xN[4], int yN[4], int x[4], int y[4], int sx,int sy)
{
xN[0]=x[0] * sx;
xN[1]=x[1] * sx;
xN[2]=x[2] * sx;
xN[3]=x[3] * sx;
yN[0]=y[0] * sy;
yN[1]=y[1] * sy;
yN[2]=y[2] * sy;

Computer Engineering Department 16


Computer Graphics Animation & Multimedia SSUET/QR/114

yN[3]=y[3] * sy;
}

void CScaleView::drawRect(int x[4 ], int y[4], CDC *pDC)


{
pDC->MoveTo(x[0],y[0]);
pDC->LineTo(x[1], y[1]);
pDC->MoveTo(x[1],y[1]);
pDC->LineTo(x[2], y[2]);
pDC->MoveTo(x[2],y[2]);
pDC->LineTo(x[3], y[3]);
pDC->MoveTo(x[3],y[3]);
pDC->LineTo(x[0], y[0]);
}

Result:

Lab Tasks:

1. Draw a rectangle and then Scale it by a factor of 3 and color their boundary
2. Draw a rectangle and then Scale it by a factor of 1 and color their boundary.
3. Draw a rectangle and then Scale it by a factor of 0.5 and color their
boundary.

Computer Engineering Department 17


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab#7
Open Ended Lab

1)Objective :

2)Software Required

3)Diagram

4)Methodology

5)Results

6)Conclusion

Computer Engineering Department 18


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab#8
Objective :

Demonstrate to Introduction to 3-D Max

Theory:
#01: Local Coordinates (Teapot)

1. Open 3D Studio MAX, or if it is already open, select File | Reset.

2. In the Top viewport, create a Cylinder at approximate XY coordinates (66, -66). Make
the cylinder approximately 13 units in radius and 40 units in height. These dimensions
can be altered in the Parameters rollout of the Create panel or the Modify panel.

3. In the Top viewport, create a Teapot near the center (aka "origin") of the world, at XY
coordinates (0,0). Make the teapot about 45 units in radius.

4. In the Main Toolbar, click on Select and Rotate. It turns green to show that the
transform is active.

5. Position the cursor over the teapot in the Top viewport. Do not select any element of the
Transform Gizmo, just select and rotate the teapot until its spout is pointing at the
Cylinder object. (If the teapot rotates in an unexpected direction, undo the rotation and
make sure the current Reference Coordinate System is "View" and the Axis Constraint
is "Restrict to Z.")

6. Click Select and Move in the Main Toolbar. Right-click an empty space in the Front
viewport, then select the Y-axis of the teapot is Transform Gizmo. Use the Transform
Gizmo to move the teapot about 50 units up, so the teapot is hovering in the air just
above the cylinder.

7. Right-click in an empty area of the Perspective viewport to select it. In the Viewport
Controls Toolbox in the lower right corner of the screen, click Zoom Extents. Your
screen should now look something like the illustration below.

Computer Engineering Department 19


Computer Graphics Animation & Multimedia SSUET/QR/114

8. Click Select and Rotate in the Main Toolbar. Select the Transform Gizmo of the teapot
in the Perspective viewport. Attempt to rotate the teapot as if you were to pour tea into
the cylinder. Using the default View coordinate system (which, in the Perspective
viewport, is actually the World coordinate system), it is impossible to rotate the teapot to
get the desired effect. The teapot's spout always misses the target. You might be able to
get it into a static position by making several rotations in various axes, but you cannot
simulate a pouring motion. This means that you will have problems trying to animate a
pouring movement by rotating the teapot in the world axes. Undo the rotations to restore
the teapot to the upright position seen in step 7.

9. With the teapot still selected, choose Local from the Reference Coordinate System drop-
down list in the Main Toolbar. Observe how the Transform Gizmo changes to indicate a
different orientation of the teapot's XYZ axes. Position your cursor over the Y-axis of the
Transform Gizmo so it turns yellow. Click and drag to rotate the teapot around its local
Y-axis. Pouring into the cylinder is easily accomplished. See the illustration on the
following page.

Computer Engineering Department 20


Computer Graphics Animation & Multimedia SSUET/QR/114

10. As you interactively rotate the teapot, notice how unnatural the movement seems. This
is because the Pivot Point is at the bottom of the teapot. In the real world, the point of
rotation might be near the object's center of gravity, or at a joint or connection. For the
teapot, the handle is an appropriate point of rotation.

11. With the teapot still selected, and hovering in the pouring position, go to the Hierarchy
panel. Select Affect Pivot Only _ it turns blue to indicate that it is active. The Pivot Point
tripod instantly appears, superimposed over the Transform Gizmo.

12. Click Select and Move, and choose the Local coordinate system from the drop- down
list in the Main Toolbar. In the Perspective viewport, select the ZX plane of the
Transform Gizmo by hovering your cursor over the blue and red corner icon. The Z and
X axes of the Gizmo turn yellow. Click on the corner icon and drag the Transform Gizmo
until it is located in the loop of the teapot's handle. Observe the movement of the Gizmo
and Pivot Point in the other viewports. Click Min/Max Toggle to maximize the
Perspective viewport. Your screen now looks like this:

Computer Engineering Department 21


Computer Graphics Animation & Multimedia SSUET/QR/114

13. In the Hierarchy panel, click Affect Pivot Only again to turn off Pivot Point
Transforms. The Pivot Point icon disappears, leaving only the Transform Gizmo. Click
Select and Rotate, select the local Y-axis of the teapot once more, and rotate. With the
Pivot Point in its new position, the teapot now spins around its handle for a more
convincing tea party.

- If you wish, you can make a short animation, but it is not required. The point of this
exercise is to illustrate the local coordinate system and placement of pivot points.

14. Experiment with coordinate systems and Pivot Points. Try moving the Pivot Point of the
teapot outside the object. Find out what happens when you rotate an object's Pivot Point,
then move and rotate the object in its local axes.…

Computer Engineering Department 22


Computer Graphics Animation & Multimedia SSUET/QR/114

#02: Extrude (Logo)

1. Open 3D Studio MAX, or if it is already open, select File | Reset.

2. On the Command Panel, open the Create panel. Click the icon to create Shapes. The
drop-down list reads Splines.

3. Under the Object Type rollout, click the Text button. It highlights in green to indicate
that you are in text creation mode. Several rollouts appear in the Create panel. Look at
the Parameters section _ at the bottom is a box labeled Text. The default text is already
entered: "MAX Text." Select this with the mouse, then type in your own name.

4. Right-click the Front viewport to activate it. Then left-click near the world origin to
create the text object.

5. Select the Modify panel. Here you can change the name of your text object, which is
called Text01 by default.

Computer Engineering Department 23


Computer Graphics Animation & Multimedia SSUET/QR/114

6. In the Parameters rollout, you can change the font of your text object by selecting an
installed TrueType font from the drop-down list. (The default font is Arial.) You can also
change other parameters, such as the size of the letters and their kerning (space between
letters). Adjust these parameters until you are happy with the appearance of your name.
You can even edit the text after the object has been created.

It helps to click the Zoom Extents All button in the Viewport Controls Toolbox, located in
the lower right of your screen. Now you can see the complete text object in all viewports.

7. At the top of the Modify panel is the list of Modifier buttons. Click the one-labeled
Extrude. Immediately, the 2D text is converted into a 3D solid. The text appears solid in
any shaded viewports -- those that are not displaying wireframes. The Perspective
viewport is shaded by default.

8. Look at the Parameters rollout for the Extrude modifier. The first parameter is the
Amount of extrusion. This is the depth of the 3D object. Increase the Amount by
dragging the spinner. Note that you can define a negative value for the amount.

9. If you wish to make further changes to the logo, simply click on the Modifier Stack drop-
down list and select the Text object.

Computer Engineering Department 24


Computer Graphics Animation & Multimedia SSUET/QR/114

Now you can edit the text once again. If the Show End Result button is pushed in, you can
see the object after all modifiers have been applied -- in this case, after the Extrude
modifer.

Extra credit:
The Extrude modifier works with any closed spline shape, not just text objects. For extra
credit, you can create a personal signature from an extruded spline. The thing to keep in
mind is that all splines must be part of the same object, and these splines must not
intersect with each other. Use the Attach button in the Editable Spline (Line) Modify
panel to attach several splines together into one object.

LEGAL for extrusion ILLEGAL for extrusion

Computer Engineering Department 25


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab #9
Objective :
Illustrate Shapes using 3D-Max
Theory :

#03: Lathe (Martini)

1. Open 3D Studio MAX, or if it is already open, select File | Reset.

2. Begin by setting the Units in MAX to feet and inches. This way, your objects will be
scaled as they would in the real world. Go to the Customize menu, and select Units
Setup. In the Units Setup dialog, select US Standard. The drop-down list should read
Feet w/ Decimal Inches. Under Default Units, select Inches.

Changing the Units Setup does not affect MAX's internal calculations; it merely changes
how units are displayed onscreen. Checking Inches under Default Units means that when
you type a number, MAX interprets that value in inches.

3. Maximize the Front viewport, and then click the 3D Snaps button to activate Snaps.

Right-click the 3D Snaps button to open the Grid and Snap Settings dialog. In the
Snaps tab, make sure that Grid Points is the only option checked. Then go to the Home
Grid tab and make sure Inhibit Grid Subdivision is unchecked (turned off). See the
illustrations below.

Computer Engineering Department 26


Computer Graphics Animation & Multimedia SSUET/QR/114

When you are done, close the Grid and Snap Settings dialog box.

4. using the Region Zoom tool, zoom in to the Front viewport until the height of the
viewport is about 6 inches in MAX units.

To help you do this, look at the cursor position readout in the Status Line at the bottom of
the screen.

You know you have zoomed into the scene correctly when your cursor reads approximately
6 inches in the Z dimension while placed at the top of the viewport. When you place the
cursor at the bottom of the viewport, the Status Line should read approximately zero inches.
Refer to the illustration below.

Computer Engineering Department 27


Computer Graphics Animation & Multimedia SSUET/QR/114

5. Now you are prepared to create a martini glass, which is about five inches tall. In the
Create panel, select Shapes, Splines. Then click on the Line creation button.

In default Line creation mode, you click to create Corner points and click-drag to create
Bezier points. Here, we will create Corner points at first, then convert them later.

Starting at the origin, with Snaps still on, click to create a point, and then move the
cursor to create a second point at 0'-2", 0, 0. Continue clicking to create points until
you have something resembling the following:

Computer Engineering Department 28


Computer Graphics Animation & Multimedia SSUET/QR/114

After you, create the last point (where the inside of the glass meets the stem), right- click to
end Line creation mode.

6. Chances are, your first attempt does not look much like the illustration above. To edit
your line, go to the Modify panel. With the line selected, enter Vertex Sub- object mode
by clicking on the Vertex icon, or by clicking the Sub-object button and selecting Vertex
from the drop-down list.

Now you can Select and Move points within the line until it takes on the rough shape of a
half-profile of a martini glass.
7. A real martini glass has some curves, so we need to further refine this line. Begin by
zooming in on the base of the glass. Turn off 3D Snaps.
Select both vertices on the outer edge of the glass by dragging a window around them. Then
right-click either vertex. The context-sensitive right-click menu appears. Look for the list
of vertex types, and select Bezier Corner to convert both vertices from Corner to Bezier
Corner.

Computer Engineering Department 29


Computer Graphics Animation & Multimedia SSUET/QR/114

8. Turn off the display of the Transform Gizmo, because it will only get in the way when
editing Bezier curves. Go to the Views menu and deselect Show Transform Gizmo.
Verify that you are in the View coordinate system, and axis constraints are set to the XY
plane.

9. Select one of the outer vertices. Then select one of the green boxes, which are called
tangent handles. Adjust the tangent handle so that the line segment between the two
outer vertices is curved. The base of the glass should remain flat.

Then adjust the other point until you get a natural-looking curve for the rim of the
base. It might end up looking something like this:

10. Now we will create a curve where the base meets the stem. Scroll the Modify panel
until you come to the Geometry rollout. Then click the button, which is labeled Fillet.

Computer Engineering Department 30


Computer Graphics Animation & Multimedia SSUET/QR/114

While Fillet mode is active, position the cursor over the vertex located at the
bottom of the stem. The cursor changes to a Fillet icon. Click-drag upward and the
selected point is converted into an arc with a vertex at either end. When you have a
curve that looks correctly proportioned for the martini glass, release the mouse
button. If you do not like what you did, use the Undo command. Refer to the
following illustration.

11. Use the same Fillet technique to create a curve between the stem and the chamber.

Computer Engineering Department 31


Computer Graphics Animation & Multimedia SSUET/QR/114

12. Convert the two vertices at the top rim of the glass to Bezier Corner vertices. Edit the
positions of the vertices and their tangent handles to produce a natural looking rim.

You may notice that the curve at the rim is not as smooth as in other places on the line. You
can fix this by using adaptive spline curvature. In the Modify panel, open the General
rollout and select Adaptive. The curve of the rim is automatically made smoother.

13. Create a curve at the bottom of the glass by refining the spline. In the Modify panel,
Geometry rollout, click the button labeled Refine. Then, as you hover the cursor over the
line, the cursor changes to a Refine icon. Click near the bottom of the inner edge of the
glass to create a new vertex. Then right-click to exit Refine mode.

Computer Engineering Department 32


Computer Graphics Animation & Multimedia SSUET/QR/114

14. Refining the curve by adding a new vertex does not change the shape of the spline. It
allows us to create a curve at the bottom of the glass without disturbing the straight line
nearby. Turn the Transform Gizmo back on from the Views menu. Select the vertex at
the bottom of the chamber. Convert it to a Bezier Corner vertex. Then move the vertex
up in the Y-axis by selecting the Y-axis of the Transform Gizmo.

Finally, adjust the tangent handle to produce the correct concave curve.

Computer Engineering Department 33


Computer Graphics Animation & Multimedia SSUET/QR/114

15. Use Zoom Extents All to see the entire line. Turn off Sub-object mode. Add a
Lathe modifier to produce a surface of revolution.

Under Align, select Max. Under Output, select Patch. You should see this result:

16. The martini glass model is finished. Minimize the Front viewport and look at the model
in the Perspective view. If you do not see anything, it is because the model

Computer Engineering Department 34


Computer Graphics Animation & Multimedia SSUET/QR/114

is very small relative to the world, and you need to adjust the Viewport Clipping Planes.

Right-click on the Perspective viewport label, then select Viewport Clipping from the
pop-up menu. Two red rectangles appear on the right side of the Perspective view. Move
the bottom triangle down to the bottom of the viewport. This prevents objects, which are
very close to the picture plane from being clipped.

17. If the glass appears strangely inside out as in the picture above, select the Flip Normals
option in the Parameters rollout. The model now looks correct.

18. If you look at the bottom of the glass, you will see a strange puckering of the geometry.
This is a minor bug in 3DS MAX. The workaround is to close the original spline, and use
polygonal mesh output instead of Bezier patch output. Go to the Modifier Stack and
descend down to the level of the Line object. Activate

Computer Engineering Department 35


Computer Graphics Animation & Multimedia SSUET/QR/114

Sub-object Vertex mode, and click the Connect button. Then click-drag from one
of the end vertices to the other.

When the curve is closed, click the Connect button again to turn the Connect tool off.

19. Exit Sub-object mode, and return to the level of the Lathe modifer in the stack. If
necessary, turn off the Flip Normals option. Change the Output to Mesh, and
increase the number of Segments.

Computer Engineering Department 36


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab #10
Objective:

Illustrate Transformations on Shapes using 3D-Max

Theory:

#04: Cloning and the Xform Modifier (Daisy)

We will be making a couple of flowers, which blow in the wind.


1. Open 3D Studio MAX, or select File | Reset. Maximize the Perspective viewport and
create a sphere at approximate coordinates (0, 0, 0). Give it a radius of about 20 units.
2. Select the sphere and go to the Modify panel. Click the Edit Stack button and select
Convert to Editable Mesh. (Alternately, you may right-click the sphere and select
Convert to Editable Mesh.)
3. With the sphere still selected, go to the Modifiers rollout of the Modify panel. Click the
More button. Scroll down and select Xform. Click OK to add the Xform modifier to the
sphere.
4. Minimize the Perspective viewport. Then click Zoom Extents All in the viewport control
toolbox. All viewports zoom in to the sphere. Make sure the sphere's Sub- object button
is turned on (yellow) and the selection level in the drop-down list is set to Gizmo.
5. In the Main Toolbar, click and drag on the Scale button. From the flyout, select Non-
Uniform Scale. Right-click an empty area of the Top viewport to select it. With the
Reference Coordinate System set to View, click the Y-axis of the sphere's Transform
Gizmo. Drag to scale the sphere along the Y-axis of the viewport. As you drag the
mouse, watch the Status Bar as it interactively updates the scale percentages. Scale the
sphere to about 20% of its original depth. Your screen should look like this:

Computer Engineering Department 37


Computer Graphics Animation & Multimedia SSUET/QR/114

6. Select Edit | Clone from the Menu Bar, and create a copy of the modified sphere. With
the second sphere automatically selected, go to the Hierarchy panel and click Affect
Object Only so the button turns blue.
7. Click Select and Move from the Main Toolbar. In the Perspective viewport, drag the
second sphere's Transform Gizmo in the Z-axis of the View (or World) coordinate
system. Move the second sphere up about 35 units. Notice that the Pivot Point of the
second sphere remains at coordinates (0, 0, 0). Click Zoom Extents All again to zoom
out.
8. Deselect Affect Object Only. Go back to the Modify panel and turn Sub-object on for the
sphere's existing Xform modifier. In the Main Toolbar, click Select and Non-uniform
Scale, then go to the Top viewport and scale down the flower petal in the X-axis in the
View coordinate system. You should now have the center of the flower and one petal,
like this:

9. Turn off Sub-object mode. Right-click on the Perspective viewport to select it. With the
flower petal still selected, click Array from the Main Toolbar. The top of the dialog box
should read "Array Transformation: World Coordinates (Use Pivot Point Center)."

10. In the Array dialog box, look in the Incremental section. Under the Y column, and in
the row labeled Rotate, enter the number 30 and hit the Tab key. This assigns an axis of
rotation, and an angle of rotation for each successive copy relative to the last, in degrees.

Computer Engineering Department 38


Computer Graphics Animation & Multimedia SSUET/QR/114

11. You will see that entering 30 degrees under Incremental causes an update in the Totals
section. With the default Count of 10 objects in the Array, multiplied by an angle of 30
degrees, the total rotation is 300 degrees. Enter 12 in the box marked Array Dimensions,
1D, and Count. Hit the Tab key to enter the number without closing the dialog box. The
Totals section reflects the change: 12 copies multiplied by 30 degrees = 360 degrees
total. Click OK.

12. From the Menu Bar, click Edit | Select All. With the entire flower high-lighted, right-
click it and select Collapse Selected to Mesh. This erases the Xform modifiers and all
Sphere parameters, leaving you with all objects of the type Editable Mesh.

13. Select the center of the flower. In the Modify Panel, verify that Editable Mesh is the
current object type, listed under Modifier Stack. Scroll down to the Edit Geometry
rollout. Click Attach List. When the dialog box comes up, select all objects in the list.
Click Attach to close the Attach List dialog. You now have a single mesh object for the
flower and its petals.

14. Add a new Xform modifier to the flower. Under the Modifier rollout, click the more
button and select Xform from the bottom of the list. Make sure that you are in Sub-
Object: Gizmo mode; it should be turned on automatically when you add the Xform
modifier. Tilt the flower back a bit by rotating it in its local X-axis.

Computer Engineering Department 39


Computer Graphics Animation & Multimedia SSUET/QR/114

Right click the flower and Convert to Editable mesh again. Go to the top of the Modify
panel and rename your object "Flower."

15. In the Top viewport, create a cylinder at the center of the world to be used for the flower
stem. Give it a height value of _200 so it is below the flower. Change the number of
Height Segments for the cylinder to 12. If the cylinder sticks out of the front of the
flower, reduce its radius or move it back so the stem does not come through the front of
the flower head. After clicking Zoom Extents All in the viewport control toolbox, your
screen looks like this:

16. Select the flower head. Under the Edit Geometry rollout of Editable Mesh, click
Attach. Move your cursor to the stem cylinder; the cursor turns to a plus sign. Click the
cylinder to attach it to the flower. Right-click an empty viewport area to finish the Attach
command; its green button turns grey again. The Cylinder is automatically collapsed to an
Editable Mesh and attached to the flower.

17. Add a Bend modifier to the flower. Turn on Sub-object, and select Center from the
drop-down list. In the Front viewport, move the Transform Gizmo down in the Y- axis, in
the View Coordinate System. Move the Center of the Bend modifier's effect to the bottom
of the flower stem. Change the Bend Angle to about 45 degrees. Bend Axis should be "Z".

Computer Engineering Department 40


Computer Graphics Animation & Multimedia SSUET/QR/114

18. Turn off Sub-object. Select the flower in the Front viewport. With the Select and Move
transform on and the View coordinate system active, hold down the Shift key while
dragging the flowers Transform Gizmo in the X-axis. In the Clone Options dialog, select
Instance. Now when you alter the Bend parameters of either flower, they both sway in the
breeze.

Computer Engineering Department 41


Computer Graphics Animation & Multimedia SSUET/QR/114

19. Try creating reference objects instead. You can add more modifiers to referenced
objects without affecting the master object or any of the other references. Any changes to
the master object will be seen in the references, but additional modifiers in the references
will not affect the master object.

Computer Engineering Department 42


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab #11

Objective :
Apply Animation using 3D-Max

Theory:
5: Basic Keyframing (The Bouncing Ball, part 1)

This tutorial will introduce you to basic keyframe animation in 3D Studio MAX.

1. Open 3D Studio MAX, or select File | Reset. Maximize the Top viewport and create a
Sphere with a radius of about 10 units.

2. Still in the Top viewport, create a Plane (in Create Panel | Standard Primitives). Make
it approx 200 x 200 units in size. Center it on the world coordinate system. This will be the
ground plane.

3. Switch to the Perspective viewport and click Zoom Extents. This zooms the viewport
out to make all scene geometry visible.

Move the sphere so that it hovers over the left side of the ground plane. The absolute
position of the sphere in world coordinates should be approx (-100, 0, 50).

Make sure the ball is correctly positioned over the ground plane by checking the Top
viewport.
Computer Engineering Department 43
Computer Graphics Animation & Multimedia SSUET/QR/114

4. With the Current Time field displaying frame zero, and the sphere selected, right- click
on the Time Slider. The Create Key dialog box comes up; it should say "Source Time: 0,
Destination Time: 0." Click OK to create a keyframe for the position, rotation, and scale of
the sphere at frame zero. Notice the small grey egg icon on the far left, just below the Time
Slider. You just created this key, being displayed in the Track Bar.

5. Click the Animate button; it turns red. (The Animate button remains on for the rest of the
exercise.) In the Current Time field, type in frame 50. The Time Slider moves to frame 50.

Computer Engineering Department 44


Computer Graphics Animation & Multimedia SSUET/QR/114

Move the sphere so it hovers over the center of the ground plane by selecting the X- axis of
the sphere's Transform Gizmo.

6. With the sphere still selected, click the Align icon.

The cursor changes to an Align icon; select the ground plane.

The Align dialog comes up. Under Align Position (World), check the Z Position box; the
sphere moves to intersect the ground plane. In the Align dialog, look under Current Object
and select Minimum. The bottom of the sphere should be aligned with the ground plane.
Click OK to exit the Align dialog.

Computer Engineering Department 45


Computer Graphics Animation & Multimedia SSUET/QR/114

7. Rewind the animation to frame zero and play it. The sphere should fly from its initial
position on the upper left, to land on the ground plane at frame 50.

8. Fast forward the animation to frame 100 and move the sphere to the upper right of the
screen, automatically creating another key at frame 100. Playing the animation shows
that the sphere floats across the screen in an arc. To make it bounce, we must add more
keyframes.

9. Go to frame 15 by typing it in the Current Time. Move the ball up in the world Z axis,
about as high as it was at frame zero. Repeat this process to create another key at frame
85. Play the animation again; you should have more of a bouncing motion now.

10.With the sphere still selected, open the Motion panel and click Trajectories. Now you
can see the path of the ball.

Computer Engineering Department 46


Computer Graphics Animation & Multimedia SSUET/QR/114

11.In the Motion Panel, select Sub-Object Keys. Under Trajectories, click Add Key.
Position your cursor over the sphere's blue trajectory. Your cursor turns to a plus sign.
Add two more keyframes close to the bounce point, one on either side of the impact at
frame 50.

12.Turn Add Key off. With the Select and Move command, adjust your new keyframes. To
make sure the ball bounces in a straight line, take care to only move the keys in the XZ
axis. Select the red and blue corner icon of the Transform Gizmo and move the keys to
positions that look good to you.

13.Play the animation. Adjust the keys more to get a better bouncing motion. The keys can
be moved through space by using the Transform Gizmo, or moved in time by dragging
the key's egg icon in the Track Bar. Tweak the animation until it looks more convincing,
adding additional keyframes where necessary. The small white dots on the Trajectory
represent in-between frames based on your keys. Where the dots are farther apart, the
object is moving faster. See below.

Computer Engineering Department 47


Computer Graphics Animation & Multimedia SSUET/QR/114

14.The ball needs a little squash and stretch to make it look rubbery. We will come back to
this in the next tutorial. We will also use Function Curves to make the bounce more
naturalistic, while using fewer keyframes

Computer Engineering Department 48


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab#12
Objective :
Apply Animation with Bipad using Foot Steps

Theory:

When it comes time to animate a biped, there are two modes that you can use: Footstep Mode
and Freeform Mode. Both have advantages. Footstep Mode is useful for characters that need to
walk, run, or jump. It ensures that the feet stay parallel to the ground at all times and can be used
to walk over rough terrain. Freeform Mode doesn't constrain the biped and is used for all other
actions. Most animation sequences use a combination of both modes.

Using Footstep Mode

In Footstep Mode, you animate the movement of the biped by placing footprints for the biped to
follow. These footprints can be positioned anywhere within the scene, and the biped
automatically creates the motion required to have the biped follow the footprints including all the
realistic secondary motion such as swinging arms. You can also select to have the biped motion
be walking, running, or jumping using the buttons in the Footstep Creation rollout.

Using the Walk Footstep and Double Support values located under the Walk button, you can set
how quickly the footstep animation happens. The Walk Footstep value is the number of frames
for which the foot remains within the footstep, and the Double Support value is the number of
frames during which both feet are touching the ground.

For the Run and Jump options, the Run Footstep and 2 Feet Down values define the number of
frames in which the foot is (or feet are) within the footstep, and the Airborne values define the
number of frames in which both feet are in the air.

Footstep Mode is enabled by clicking the Footstep Mode button in the Biped rollout of the
Motion panel. This button turns light yellow when enabled and opens several additional rollouts.

The easiest way to create footsteps is to click the Create Footsteps (at current frame) button in
the Footstep Creation rollout and then click in the viewport where the footprints are to be
located. By default, the left foot is placed first and the footprints alternate between right and left.
Left footprints are marked in blue, and right footprints are marked in green. Until keys are
created, you can select, move, and rotate footsteps.
After several footprints are added to the scene, clicking the Create Keys for Inactive Footsteps
button in the Footstep Operations rollout creates the keys for the biped following the footsteps.
After the keys are created, the biped is moved to the location of the first footprint, and dragging
the Time Slider (or clicking the Play Animation button) moves the biped through the available
footsteps.
After a sequence of footprints exists, you can add more footsteps using the Create Footsteps
(Append) but-ton in the Footstep Creation rollout. This button lets you place more footsteps,
continuing the sequence already laid out.
To automatically create multiple footsteps that are equally spaced Click the create multiple
Footsteps button in the footsteps Creation rollout.
This opens a dialog box, shown in Figure , that lets you specify which foot is first, the total
number of footsteps, the stride width, and many other settings associated with the first and last
Computer Engineering Department 49
Computer Graphics Animation & Multimedia SSUET/QR/114

steps

Figure : Th e Create Multiple

If a footstep is selected, the Footstep Operations rollout includes buttons to deactivate, delete, or
copy the selected footstep. If you copy a footstep and then forget what is in the copy buffer, you
can enable the Buffer Mode button in the Biped rollout to see the motion of the footstep that is in
the buffer.

The Dynamics &Adaptation rollout includes a GravAccel value. This value is used to determine
how quickly the body returns to ground during a run or jump cycle. To simulate a character
jumping on the moon, reduce the GravAccel value. There are also several Footstep Adapt Locks
that can be set.

Computer Engineering Department 50


Computer Graphics Animation & Multimedia SSUET/QR/114

Tutorial: Making a biped jump on a box

Although we could easily make our biped dance the two-step, this tutorial has the biped walk a
few steps, transition to a run, and then jump on top of a stationary box.

To make biped jump on a box, follow these steps:

1. Select the Create Standard Primitives Box menu command, and drag in the Top
viewport to create a simple box.
2. Select the Create Systems Biped menu command, and drag in the Top viewport to
create a biped object. Be sure to leave enough room between the biped and the box so the
biped can get a running start.
3. Open the Motion panel, and click the Footstep Mode button in the Biped rollout to enter
Footstep Mode.
4. In the Footstep Creation rollout, select the Walk button and click the Create Footsteps
button. Then click in the Top viewport to create four footsteps in front of the biped object
starting with the right foot.
5. Choose the Run option in the Footstep Creation rollout, select the Create Footsteps
(append) button, and add four more steps that are spread out slightly more than the first
steps.
6. Choose the Jump option in the Footstep Creation rollout, and click the Create Multiple
Footsteps button. In the Create Multiple Footsteps dialog box that opens, set the Number
of Footsteps to 2, and click the OK button.

The two footsteps where the biped lands should be in the center of the box object.

7. Select and move the final two footsteps upward in the Left viewport to be on top of the
Box object.
8. Click the Create Keys for Inactive Footsteps button in the Footstep Operations rollout to
create the keys for the available footsteps.
9. Click the Play Animation button to see the biped walk, run, and jump on the box. Figure
42.10 shows the biped as he hops onto a box object.

Computer Engineering Department 51


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab#13
Objective :
Illustrate Working with Curves & Camera

Theory:

1. To access the panel that we need to draw CV curves, start with the Create panel and select
Shapes. In the dropdown box, choose NURBS Curves.

2. Click on the CV Curve button.


3. In the top viewport, draw a CV curve. Look at the curve in the Perspective viewport.

4. Click on Quick Render to view the curve.

5. You will not see the curve. Why is that?

Computer Engineering Department 52


Computer Graphics Animation & Multimedia SSUET/QR/114

6. You will need to check Render able.


7. Try viewing it again. This time you can see the curve.
8. To see the actual CV curve in real time, check Display Render Mesh.

9. Try changing the number of sides down to 3. It has now become a triangle shape.

Computer Engineering Department 53


Computer Graphics Animation & Multimedia SSUET/QR/114

10. To hide the actual width of a curve in Perspective view, check Use Viewport Settings.

11. Uncheck Use Viewport Settings and try increasing the Thickness of the curve.

1. Turn off the animate button. Activate the Top viewport, and go to the Create panel. Click
the Cameras icon and select Target. Now click and drag anywhere in the Top viewport to
Computer Engineering Department 54
Computer Graphics Animation & Multimedia SSUET/QR/114

create the camera and its target.


With the camera still selected right-click the Perspective viewport. In the Menu Bar,
click on the Views menu, and select Match Camera to View. The camera and target
now snap to the new position. Right-click the Perspective viewport label and drag the
mouse to Views, then Camera01. The Perspective viewport changes to the Camera
view.

Computer Engineering Department 55


Computer Graphics Animation & Multimedia SSUET/QR/114

2. Maximize the Camera viewport. Use the Dolly and Truck controls in the viewport
toolbox to frame the shot. The shot should be tight enough so that the animation begins and
ends with the ball at off-screen positions.

Use Dolly and Truck to adjust the camera view

3. Minimize the Camera viewport and switch to Top view. Click Zoom Extents All to see
all of the objects. From the Create panel, click the Lights icon. Select Target Spot. Create a
spotlight in Top view by click dragging to establish the position of the light, and then its
target. Position the light to the left of the camera, and place the spotlight's target near the
World origin.

4. In Front view, move the light up in its local Y-axis, so that it can shine down on the
scene. Right-click on the Left viewport label, and select Views, Spot01. From the spotlight's
point of view, you can adjust where it shines using buttons in the viewport toolbox. These
tools are similar to camera adjustments.

Computer Engineering Department 56


Computer Graphics Animation & Multimedia SSUET/QR/114

5. With the light selected, go to the Modify panel and expand the Shadow Parameters
rollout. Turn Object Shadows on. Advance the Time Slider to about frame 40. Right-click
the Camera viewport to select it, and then click the Render Scene icon.

6. In the Render Scene dialog, Time Output should be Single. Change the Output Size to
320 x 240 and click Render. You should see the shadow of the Ball on the ground. See the
illustration of the Render Scene dialog below.

7. If the rendering looks good, click Render Scene again. Change Time Output to Active
Time Segment. Under Render Output, click on the Files button. You will get the Render
Output dialog. Browse to, or create, a local folder to keep your animation. Make it an AVI
file by typing in the filename with an .avi extension. Use Indeo compression, with quality
set to 100%. Click OK to get out of the Video Compression setup, and then save to get out
of the Render Output dialog. Then click Render in the Render Scene dialog, and your
animation begins rendering.
8. When it is finished, view it with RAM player. Select Rendering tab in the Tab Palette,
then click RAM Player. Within RAM Player, click Open Channel A and browse to open
your AVI animation.

Computer Engineering Department 57


Computer Graphics Animation & Multimedia SSUET/QR/114

Lab#14
Open Ended Lab

1) Objective :

2) Software Required

3) Diagram

4) Methodology

5) Results

6) Conclusion

Computer Engineering Department 58


Computer Graphics Animation & Multimedia SSUET/QR/114

Computer Engineering Department 59

You might also like