answersLogoWhite

0


Best Answer

//reflection for triangle

# include <iostream.h>

# include <conio.h>

# include <graphics.h>

# include <math.h>

char IncFlag;

int PolygonPoints[3][2] =

{{10,100},{110,100},{110,200}};

void PolyLine()

{

int iCnt;

cleardevice();

line(0,240,640,240);

line(320,0,320,480);

for (iCnt=0; iCnt<3; iCnt++)

{

line(PolygonPoints[iCnt][0],PolygonPoints[iCnt][1],

PolygonPoints[(iCnt+1)%3][0],PolygonPoints[(iCnt+1)%3][1]);

}

}

void Reflect()

{

float Angle;

int iCnt;

int Tx,Ty;

cout<<endl;

for (iCnt=0; iCnt<3; iCnt++)

PolygonPoints[iCnt][1] = (480 - PolygonPoints[iCnt][1]);

}

void main()

{

int gDriver = DETECT, gMode;

int iCnt;

initgraph(&gDriver, &gMode, "C:\\TC\\BGI");

for (iCnt=0; iCnt<3; iCnt++)

{

PolygonPoints[iCnt][0] += 320;

PolygonPoints[iCnt][1] = 240 - PolygonPoints[iCnt][1];

}

PolyLine();

getch();

Reflect();

PolyLine();

getch();

}

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Algorithm for reflection and translation for triangle in computer graphics?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is hidden line surface?

In 3D computer graphics, hidden surface determination (also known as hidden surface removal (HSR), occlusion culling (OC) or visible surface determination (VSD)) is the process used to determine which surfaces and parts of surfaces are not visible from a certain viewpoint. A hidden surface determination algorithm is a solution to the visibility problem, which was one of the first major problems in the field of 3D computer graphics. The process of hidden surface determination is sometimes called hiding, and such an algorithm is sometimes called a hider. The analogue for line rendering is hidden line removal. Hidden surface determination is necessary to render an image correctly, so that one cannot look through walls in virtual reality.


Which compiler is best compiler and why in computer graphics?

Compilers have nothing to do with graphics. Compilers translate source code into object code, nothing more. Graphics is hardware-dependant and is a function of a graphics library specific to that hardware. Graphics libraries do not need to be compiled, they simply need to be linked to your code.


What is the use of FORTRAN in computer graphics?

Ps i think wiki ansewrs stinks


What are the Name of softwares of computer graphics?

Adobe photoshop, coral draw etc


What degree do you have to have to be a designer?

You need bachelor in graphics designer or bachelor in computer arts. Both things are to much similar.The Professional designer is one who have a degree of graphics design.

Related questions

Algorithm for drawing circle in context of computer graphics?

Bresham's Mid point circle drawing algorithm.


What is clipping algorithm in computer graphics?

The drawing will happen only within the clipping area, Anish


What is translation in computer graphics?

I don't know and I don't care.


What is three dimensional transformation in computer graphics?

translation,scaling,rotation


What has the author Gilbert Paul Lauzon written?

Gilbert Paul Lauzon has written: 'A computer-graphics separation algorithm for pattern classification and cluster analyiss'


Why is a computer good for graphics?

Depending on the graphics card in your computer it will state the graphics you have


What are Points and lines in computer graphics?

whait is point in computer graphics


What are the common examples of computer graphics?

computer graphics are used in games. films are also produced by computer graphics.


Passive computer graphics?

Its just an another name of non - interactive graphics. Actually interactive and non - interactive graphics are a classification of computer graphics on the basis of interaction of the computer graphics system towards users.


What do you mean by interactive and passive computer graphics. also explain how does an interactive computer graphics works?

passive and interactive computer graphics example


When was Computer Graphics Metafile created?

Computer Graphics Metafile was created in 1986.


What is the Malayalam meaning of the English word graphics?

graphics means chithram in Malayalam in genaral...but if you mention computer graphics....it is said as computer graphics itself.