Professional Documents
Culture Documents
A Report On
“MICRO PROJECT”
“TWINKLING STAR"
MSBTE, PUNE
Page 1 of 24
Computer Engineering Project Topic Name
CERTIFICATE
This is to certify that:
Page 2 of 24
Computer Engineering Project Topic Name
TABLE OF CONTENTS
2. Action plan 5
3. Introduction 6
4. Project Objective 7
5. Algorithm 8-9
6. Flowchart 10
7. Program 11-15
8. Output 16-19
1. Conclusion 22
2. Reference 23
Page 3 of 24
Computer Engineering Project Topic Name
ABSTRACT
Page 4 of 24
Computer Engineering Project Topic Name
ACTION PLAN
Page 5 of 24
Computer Engineering Project Topic Name
INTRODUCTION
PROJECT OBJECTIVE
Page 6 of 24
Computer Engineering Project Topic Name
Page 7 of 24
Computer Engineering Project Topic Name
ALGORITHM -
1) Initialize Graphics: Set up the graphics environment using the appropriate
C graphics library (e.g., SDL, OpenGL, or a library specific to your
development environment). Create a window or canvas for rendering.
2) Define Star Shape: Decide on the number of points for your star shape. A
typical choice might be a five-pointed star (pentagram). You can choose to
create a star shape using basic geometric principles, such as triangles and
lines, or use predefined shapes if available in your graphics library.
4) Star Positioning: Determine the position of the star on the canvas. You may
want to place it in the center of the screen or at a random position.
Page 8 of 24
Computer Engineering Project Topic Name
8) Clear and Redraw: In each iteration of the animation loop, clear the
previous frame to erase the previous state of the star, then redraw the star
in its new state.
11) Cleanup: Properly release any allocated resources (e.g., memory) and
close the graphics window when the program exits.
FLOW CHART -
Page 9 of 24
Computer Engineering Project Topic Name
Start
End
PROGRAM –
#include<stdio.h>
Page 10 of 24
Computer Engineering Project Topic Name
#include<conio.h>
#include<graphics.h>
#include<dos.h>
int main() {
if (err != grOk) {
/* error occurred */
printf("Graphics Error: %s\n",
grapherrormsg(err));
return 0;
}
/*
* draw a star and fill with different
* colors to get twinkling effect
Page 11 of 24
Computer Engineering Project Topic Name
*/
for (i = 1; i <= 15; i++) {
if (i == DARKGRAY)
continue;
setcolor(i);
setfillstyle(SOLID_FILL, i);
setcolor(DARKGRAY);
setfillstyle(SOLID_FILL, DARKGRAY);
line(midx + 30, midy, midx + 140, midy);
line(midx + 30, midy, midx, midy + 30);
line(midx + 140, midy, midx, midy + 30);
floodfill(midx + 31, midy + 1, DARKGRAY);
setcolor(DARKGRAY);
setfillstyle(SOLID_FILL, DARKGRAY);
line(midx + 40, midy + 50, midx, midy + 30);
line(midx + 40, midy + 50, midx + 110, midy + 160);
line(midx + 110, midy + 160, midx, midy + 30);
floodfill(midx + 40, midy + 51, DARKGRAY);
setcolor(DARKGRAY);
setfillstyle(SOLID_FILL, DARKGRAY);
line(midx - 40, midy + 50, midx, midy + 30);
line(midx - 140, midy, midx - 40, midy + 50);
line(midx - 140, midy, midx, midy + 30);
floodfill(midx - 40, midy + 48, DARKGRAY);
setcolor(DARKGRAY);
setfillstyle(SOLID_FILL, DARKGRAY);
line(midx - 30, midy, midx, midy + 30);
line(midx, midy - 100, midx - 30, midy);
line(midx, midy - 100, midx, midy + 30);
floodfill(midx - 28, midy, DARKGRAY);
/* sleep for 2 seconds */
sleep(2);
Page 14 of 24
Computer Engineering Project Topic Name
}
getch();
/* deallocate memory allocated for graphic screen */
closegraph();
return 0;
}
Page 15 of 24
Computer Engineering Project Topic Name
OUTPUT:
Page 16 of 24
Computer Engineering Project Topic Name
Page 17 of 24
Computer Engineering Project Topic Name
Page 18 of 24
Computer Engineering Project Topic Name
Page 19 of 24
Computer Engineering Project Topic Name
IMPLEMENTATION OF
“Project Topic Name”
1..Setup Graphics Environment:
● Initialize the graphics library (e.g., using TurboC, SDL, or OpenGL).
Page 20 of 24
Computer Engineering Project Topic Name
Page 21 of 24
Computer Engineering Project Topic Name
CONCLUSION
Page 22 of 24
Computer Engineering Project Topic Name
REFERENCE
Website Name:
● "Computer Graphics with Open GL" by Donald Hearn and
M. Pauline Baker: This is a classic textbook for learning
computer graphics with OpenGL.
Page 23 of 24
Computer Engineering Project Topic Name
Page 24 of 24