Computer Graphics

Cartesian reference frame

✓ Frame-buffer locations and the corresponding screen positions, are referenced in Cartesian coordinates. ✓ In an application (user) program, we use the commands within a graphics software package to set coordinate positions for displayed objects relative to the origin of the ✓ The coordinate origin is referenced at the lower-left corner of a screen display […]

Computer Graphics

Three- Dimensional Viewing Devices

Graphics monitors for the display of three-dimensional scenes have been devised using a technique that reflects a CRT image from a vibrating, flexible mirror As the varifocal mirror vibrates, it changes focal length. These vibrations are synchronized with the display of an object on a CRT so that each point on the object is reflected […]

Program for Bezier curve C and C++ Computer Graphics

Program for Bezier curve

/* Program to draw a Bezier Curve using graphics.h */ #include <graphics.h> #include <conio.h> #include <math.h> #include <stdio.h> void drawBezier(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) { double t; int x, y; for (t = 0.0; t <= 1.0; t += 0.001) { // Cubic Bezier […]

Program for 3D Rotation C and C++ Computer Graphics

Program for 3D Rotation

/* 3D Rotation of a Cube using graphics.h (BGI/WinBGI) */ #include <graphics.h> #include <conio.h> #include <math.h> #include <stdio.h> #define PI 3.14159265 // Projection function (simple perspective projection) void project(int x, int y, int z, int *px, int *py) { int d = 500; // distance from viewer *px = (x * d) / (z + […]

Program for 3D scaling

In computer graphics, 3D scaling is a geometric transformation used to resize objects in three-dimensional space. By applying scaling factors along the x-axis, y-axis, and z-axis, we can enlarge or shrink the size of a 3D object without altering its overall shape. Scaling is one of the most fundamental 3D transformations, along with translation, rotation, […]