Rosette
Rosette
//
#include "stdafx.h"
#include<windows.h>
#include<glut.h>
#include<gl/GLU.h>
#include<math.h>
#include<iostream>
class GLintPoint
{
public:
GLint x,y;
};
class Point2
{
public:
float x,y;
void set (float dx , float dy){x=dx; y=dy;}
void set (Point2& p){x=p.x; y=p.y;}
Point2(float xx , float yy) {x=xx; y=yy;}
Point2() {x=y=0;}
};
Point2 currPos;
Point2 CP;
void moveTo(Point2 p)
{
CP.set(p);
}
void lineTo(Point2 p)
{
glBegin(GL_LINES);
glVertex2f(CP.x , CP.y);
glVertex2f(p.x , p.y);
glEnd();
glFlush();
CP.set(p);
}
void myInit(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glClearColor(0.0,0.0,0.0,0.0);
glColor3f(0.0,0.0,1.0);
}
void render()
{
glClear(GL_COLOR_BUFFER_BIT);
glViewport(40,40,640,480);
rosette(5,0.66f);
glFlush();
}