Hi guys,
Thanks for your responses, but I’m afraid they are still a little advanced. I’ll add the code that I have so far and maybe someone could suggest a place for the random stars…I have searched all over for some code to create this but I have been running into problems.
Here it is:
#include <windows.h> // use as needed for your system
#include <gl/Gl.h>
#include <gl/glut.h>
//<<<<<<<<<<<<<<<<<<<<<<< myInit >>>>>>>>>>>>>>>>>>>>
void myInit(void)
{
glClearColor(0.0,0.0,0.0,0.0); // set black background color
glColor3f(1.0f, 1.0f, 1.0f); // set the drawing color to black
//glPointSize(4.0); // a ‘dot’ is 4 by 4 pixels
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 640.0, 0.0, 480.0);
}
//<<<<<<<<<<<<<<<<<<<<<<<< myDisplay >>>>>>>>>>>>>>>>>
void myDisplay(void)
{
glClear(GL_COLOR_BUFFER_BIT); // clear the screen
// Star #1 Alpheratz
glPointSize(9.0);
glBegin(GL_POINTS);
glVertex2i(400,155);
glEnd();
glFlush();
// Star #2
glPointSize(4.0);
glBegin(GL_POINTS);
glVertex2i(300,165);
glEnd();
glFlush();
// Star #3
glBegin(GL_POINTS);
glVertex2i(250,145);
glEnd();
glFlush();
// Star #4
glPointSize(3.0);
glBegin(GL_POINTS);
glVertex2i(260,200);
glEnd();
glFlush();
// Star #5
glBegin(GL_POINTS);
glVertex2i(250,225);
glEnd();
glFlush();
// Star #6
glBegin(GL_POINTS);
glVertex2i(150,185);
glEnd();
glFlush();
// Star #7 Markab - The Brightest Star of Pegasus
glPointSize(13.0);
glBegin(GL_POINTS);
glVertex2i(275,300);
glEnd();
glFlush();
// Star #8
glPointSize(9.0);
glBegin(GL_POINTS);
glVertex2i(400,300);
glEnd();
glFlush();
// Star #9
glBegin(GL_POINTS);
glVertex2i(225,350);
glEnd();
glFlush();
// Star #10
glBegin(GL_POINTS);
glVertex2i(100,400);
glEnd();
glFlush();
// Star #11 - Enif
glBegin(GL_POINTS);
glVertex2i(60,350);
glEnd();
glFlush();
// Star #12 - M15
glBegin(GL_POINTS);
glVertex2i(50,300);
glEnd();
glFlush();
// Connect the lines
glBegin(GL_LINE_LOOP);
glVertex2i(300,165);
glVertex2i(400,155);
glVertex2i(400,300);
glVertex2i(275,300);
glEnd();
glFlush();
// Connect the other verticies
glBegin(GL_LINES);
glVertex2i(300,165);
glVertex2i(250,145);
glEnd();
glFlush();
glBegin(GL_LINES);
glVertex2i(250,225);
glVertex2i(260,200);
glEnd();
glFlush();
glBegin(GL_LINES);
glVertex2i(300,165);
glVertex2i(260,200);
glEnd();
glFlush();
glBegin(GL_LINES);
glVertex2i(250,225);
glVertex2i(150,185);
glEnd();
glFlush();
glBegin(GL_LINES);
glVertex2i(275,300);
glVertex2i(225,350);
glEnd();
glFlush();
glBegin(GL_LINES);
glVertex2i(225,350);
glVertex2i(100,400);
glEnd();
glFlush();
glBegin(GL_LINES);
glVertex2i(100,400);
glVertex2i(60,350);
glEnd();
glFlush();
}
//<<<<<<<<<<<<<<<<<<<<<<<< main >>>>>>>>>>>>>>>>>>>>>>
int main(int argc, char** argv)
{
glutInit(&argc, argv); // initialize the toolkit
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); // set display mode
glutInitWindowSize(640,480); // set window size
glutInitWindowPosition(100, 150); // set window position on screen
glutCreateWindow(“Pegasus, The Flying Horse”); // open the screen window
glutDisplayFunc(myDisplay); // register redraw function
myInit();
glutMainLoop(); // go into a perpetual loop
}