answersLogoWhite

0

//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

12y ago

What else can I help you with?

Continue Learning about Engineering

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 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.


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 translation in computer graphics?

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


What is clipping algorithm in computer graphics?

The drawing will happen only within the clipping area, Anish


What is three dimensional transformation in computer graphics?

translation,scaling,rotation


What is the significance of reflection objects in the field of computer graphics?

Reflection objects in computer graphics are important because they allow for the realistic simulation of reflective surfaces, such as mirrors or water. By accurately reflecting light and surroundings, reflection objects enhance the visual quality of rendered images, making them appear more lifelike and immersive. This adds depth and realism to virtual environments, improving the overall quality of computer-generated graphics.


What has the author Gilbert Paul Lauzon written?

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


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 does computer graphics is all about?

Computer graphics is basically pictures, art, or designs made or put on a computer.