0% found this document useful (0 votes)
5 views30 pages

2D Animation and Graphics Programming Guide

The document outlines various programming exercises related to 2D graphics transformations, including creating animations, drawing shapes, and implementing algorithms like Bézier curves. It contains code snippets and instructions for generating simple animations and transformations, as well as descriptions of graphics functions. The document is structured with multiple pages, each focusing on different aspects of graphics programming.

Uploaded by

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

2D Animation and Graphics Programming Guide

The document outlines various programming exercises related to 2D graphics transformations, including creating animations, drawing shapes, and implementing algorithms like Bézier curves. It contains code snippets and instructions for generating simple animations and transformations, as well as descriptions of graphics functions. The document is structured with multiple pages, each focusing on different aspects of graphics programming.

Uploaded by

sankhajit124
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PAGE NO.

DATE
EXPT. NO,

BBeA 101D - II: Canputn Gophies

Expl. Wnite
animatom
waig transfanmatim.

A im:To pounrams fon making simpe


Aavelap
animaticn Azansfornotie ike sliny
otaticm ad tnanslation. The simaleanimatian ane
ginen

Aesenáptici for maney ang


Caleuata the
gtCBANdinetes
inenemetaly obget
teda pictune to ge a
Qninatin

want te
eirele to
shilt oinele aleng
x-dineefon continuely
inteniaa.

The bols

monernet
motiun
and
otaticn tanslati ete

ULTRA

Teacher's Signature
PAGE NO, o2
DATE

EXPT, NO,

[Link] cirela.
irectins

ineuee <slio h

void main )

Satenlor ()
sat pllstyle (salid- FILLa)

delay e),

setcolor(3):
setillshyle (solid-fill )
crele ; so,se)
ploodfilL Ct2,s2.3);

elean leice C
ULTRA

Teacher's Signature
PAGE NO.
DATE
EXPT. NO.

maving eixele Lon top to batton


fon

Seteolor Ca)
Selfill styk CSolTD-fIlL, 9):
crele(so,i,so);
floolillL(S2 it2,3):
elay C2):

cixele bottom to top

Setcalaz(3):
(solid -fill
set filstyle
eizeleCso, i, se)
)
(20)
elea avicer )
eirele lingenal lizeeien

Setfillshyle
9):
(soLID- FILL,

CI2it2,3)
loedfill
(2)

Soaßenm
ULTRA

Teacher's Signature
Output -
PAGE NO.
DATE
EXPT. NO.

n eee digonal
lirecticn

Seteolor Cs)i
setfillstyle CsoLID-fIIL,9):
cirele Ci So);
loodfill Cie2, i42,3)
(20) ?
Aalay,

Aáaßenmf
ULTRA

Teacher's Signature
PAGE NO.

DATE
EXPT. NO.

Ex 2. Wnite which
aethuatim list
pixel Anawing simple
2D obyeet Cetrele, Etipse ).

Deseniphm i

falleolg graphics functin


aailable fo enetig
to lineren
baint C%I, y) to point Cx2, y) ie
Cxi. y) and C>y2) ane end points of
ine
200,

300, 4oD)

uaed to drauo a cirele wite

hird þanamaten
Spacfies the adius ef the eirele.
Declarati an - eizelo Cx,) eirele Cioe 20o,25
(25is hadius centa

to da ellipse Cxy

eo-6dinate ofcentan af he ellipse


statig stazhng angle and
agleaalta
cndingagle
panamot the
n
qeeifes Qn
Yadis the ellipae,To da Canplte
and end ange shsld
ULTRA
60
Teacher's Signature
PAGE NO.
DATE
EXPT. N0.

Deelaratimi flipse Cxy, slank angle, end


xXadis, yadius);- ellipsa Csoo,2o0, 0,360,25,
iseontez of ellipae
is 360 Rnd
slant-ange
X-ais Tadius

Retange: It a to dra Keetangle


bo ttom
Co-inates
to drau the reetangly
aquired
the
t shuefiso the Y Ca- ondinat
speetiss
botti
earnen,
andinateof sigt botton
peeifies

Aclaratiam : Rectagle Clatt.


200,306, 4o0)
topniglt, ba thm)

Da to dao e

(tniangle, heetaglefegtg
ete)
Draspaly Cnum, fainta)
Salicate nembens

en: de mildnaw a

pauta [J= 320, So 420, 300 2s0, 3 00,320, so

whieh
foita
are (32o,/s0),"
Contains
20, 309 and C2so, 3oo) nae tt
loat pait (320 lGo)
ULTRA

Teacher's Signature
PAGE NO.
DATE
EXPT. N0.

sbape.i

#include <s\dio.)
ineludo < Conioh)

int gd DETECT qm

cleas euice C)
line 15o, (00, 242,16o
ellipa (2u2,l65, o, aoo,S:
|
line(15o, 60, (20, 1So)

150 320,1so)
260)
iwe320, So, 32o,200):
1ine o0, 260, 200)
l320,200, 316, 2s0):
ae
ine
290,280
130, 200
ine (270

circe (s90, 2sD,

Sakeng
ULTRA

Teacher's Signature
Oukput
:
PAGE NO. o8
DATE
EXPT. NO.

Exp 3. Write a pruograpn for genezating


sot corthel pinta.
given

Aimi o gnente S mooth by warg Bozien

tecknigee fen a giaan sot of centne painta.

Desenption'
AA Bezien a penamaten

fasqety uacd in compten gapbics and


xelated ialda
Berbe Ceees
ealleaticn
caled Baziey sueee
the beziex is spaciel
triangle

Jn nectos qraphics Boziey


Smoath Aat ean ae

Sealed indelinidey jpath as they commony

befhened ta in image manipulam p


linke bozíeY
hot bmund te limita ef nastenizel îmages
Cnd atuite to
aloo
tol to

cantrol mation.

foun potnta
the plane in highen imenial
Baze e.

ULTRA

Toacher's Signature
PAGE NO.
DATE
EXPT. NO.

The clants a fo going tosanda fe


Lnl ies t the liseetien

pass
theaepoita ane thee to pnovido
dimensicnal informatim
itnnains the
lietim before tunning tmianda

ue
The
B4) = (-° t3it),t3(1-t){ftp, tElo,1]
eaplicit

CUe

# inelude cgtaphia h)

Beziex int xu] înt yD

leabem
PAGE NO.
DATE
EXPT. NO.

putpixel Cxt yL,wita);

putpial C tiY[i), YELO):

Yous catnol pointan n)

stan

ULTRA

Teacher's Signature
Output:

Centnol pointa:

136 |20
|60

240 220

JLTE
PAGE NO.
DATE
EXPT. NO.

Ex . Wait
2D nansformation such as

The 2b tanfomadion

[Link] hamatin is doßines


oyyet fom e posihin
to
ta anethn

line path

(4,1) Co)
4S) (2,5)

hhe Can the saget basel


tramalatin distanee
X Y cis

denotea tanslatin beten


anis ty denote tyanlathim

distanee Bxis
alg

ULTRA

Teacher's Signature
PAGE NO.
12
DATE
EXPT. NO.

translatin
Piogam foz
+incude sldios)
#incude< conio- h)
# incude <gxaphics h)
+in cule < mathh

void main ls
tyty
printe (Entan tie shenting þaiot

print 'Eat endin zeint)

pnint (Enten tranalatien Bistanc n:


Setcolo (5);
line (al,yI, 2, y2)
buttent yC t2,y2t, `Oniginal line);

3h+ty
Setcoloy ();

utt snt y (yt2, Yy t2,ter

ULTRA

Teacher's Signature
Output

Enter tae staliy point ? 3o0, 200


Enten the endin peint 350,2
3so,200
Enta tranaicn distane ta,ty?
50

Oiial line
PAGE NO. 13
DATE
EXPT, NO.

[Link]
We
o&get eithen
eithen ky inceaig
Anade
baacd

axis axis

t2,5) 2,574) (1/2,5l9)

alt

Co-odinste
oetaincd as

SX and sY ae soaling facta alog

n matrix oom
X
o SY

ULTRA

Teacher's Signature
PAGE NO.
DATE
EXPT, NO,

incude csllio-h)

# incude cavaplhicsh)
+incle <math h

the
pnintEsto

scaling factor SXSY: In)


pninte (uEnten

Satolar (s)

euttet xY CxtYt2,hel
x3=X1t SX

X = X SX
Y4 = Y, SY
SatcoloY ();
(inelx3,Y3, X4 Yy
6uttext Y(X3 t2 Y3t2,

ULTRA

Teacher's Signature
Outpat
Enter te stnig point !120 160

point i1s0
100
Enter enlig
Enton disfanee sxsY:
scling
2 2

blon
PAGE NO.
DATE
EXPT. NO.

pichou by uaing the centapt


alonig

lig gien noctnal obyet wth color.


4an a

gien pichure obet wt


slo Whe Can
2ud s
One is 4 conhecled appoaeh and
He 4 connected oppeeeh an
approaelh.

such as flordell algert


1. Uaing iling algonitam

lonunday
e en
tl agon
colo the
and
chzete
senlig palygn fill algentan

inbutlt ueh as flesdell


2. laing rahies funeton

algonkm

Some e ant to fill in an

not asigle
taat
e is
paint suelh
kefined

anus
within
by neflacig
inteni
caley

Lcalr baunday
alganitm
T

nd
. is
We
Clled

eassija
stant
all
ploadlill
faam
pial
a Speailie
aes tt
inteni ox CKr) pixe
ane euzently set

-given
intezior calor weith te lesied ill
Cely

fas tan me

interir colery we Can fiat aign

ULTRA

Teacher's Signature
PAGE NO. I6
DATE

EXPT, NO.

intariox pixel
pixel auesso tuat all

ane the Same coler

& eonneeted
4 conheeted

4
Algenatam

[Link] can inplemant florll by wsing


ef allpixel shoull be Gassia to Same
2, fixst
eoo,(commn colex is blaek)
ginen obyet cheek the
3, Start witha pqint

ifCget pixalcx) = old - ten


cal)
4. Tp the abee conliticn is satisfied

eallaning 4 slepes ae follasd ia fillin

putpial (xY,flca)
losd (xt1, R-cel,old cal);
tloed Cx-l, il-cal, old-call
locd CxY+1 ill=cel, oldceld

ULTRA

Teacher's Signature
PAGE NO.
DATE
EXPT. NO0.

4 Connectad floodgil

tinclede Lstdioh)
#inchde <cnio h)
tinclude<giaphics h)

# inclule Kdosh)
iood Cint, ind int iat)
void
Void
int gd, qnn= ÞETEeI

init gaugh
Necngle

void load Cint xiat Y,int pil-col int okdcal)

Rleod(X, Ytifill calold -cal)


lezd ,y-lcol old. ca

ULTRA

Teacher's Signature
PAGE N,
DATE

EXPT NO

Exp G: Cveate
2D motiun taseun by
qraphics
maomedia

1: Open Adole lash Mocromedi losh


step

2: Insert shepesy ihune


step Arawig
text in

Step 3 cick auy 4name and prus Folay


fram

step yi Now

S: Then clik am taneline frame


Cbetwen to end)

erate motion teen

tyl entesa
stap

ULTRA

Teacher's Signature ...


Page No.

Date:

EXR 3: Gue shapetcen by aing


Macnmahia

step i Opun Macianudifadoke pash.

step 2: Tascnt ashape Cdont

Conwent

step 3: o clek any frame in this timeline

step S; Ssledt the last pama and stleet the shp

step f Delbte the slape aud dral anothen


he Same
shaso.

step 7i Nas salat shape tseon

8 Then dtaltentu

U.S.
Teacher's Signature
Page No. 20
Date :

Macromedia {lask.

slep s: Open Adoae fath Maomadia flasl

slep 2;Du)
Dra ny shape de picune in the stog

step 3:
3; click any fame

stes 4: Taen elick F6 (Keyfran)

eny frame and frsn FG


step s cick midle

Gi last frame and mone the shape


step click

Cnst be Cmnezt to
ing F&)
step 4 Nou alick fast rane

step 8: click Tottin

step q; Now olik in midole frane and notation

480

40: Ngw cliek ast


ast fname Tutato n -1
step

step 11; Then press


pra
etdt eslan

U.S.
Teacher's Signature

You might also like