$40 off Craftsman 5 Drawer Homeowner Tool Center with Riser and Parts Bins $99.99 on sale 10/2-10/8
Sears Deal of the Day: Thule Car Top Carrier, Quest

Figure 38
=========================
/*
//Author: Cheikh Drame
//To support, please do one of the following
//- Visit irap123.com many times a day
//- Join irap123.com
//- Buy my app irap123 (rhyming dictionary) available for android, and iphone. On windows phone, it is called iLyrics. If not, you can get the desktop version at www.irap123.com/apps/webstore/
//- Include irap123.com in your blogs, forums, facebook walls, email footers, comments
//- send a donation at my paypal address at cbdsigned.vevo@gmail.com
//- Buy a story at http://shop.pparzygnat.com
*/
// OpenGLpage31.cpp : Defines the entry point for the console application.
//
#include
#include
GLfloat r(double angle)
{
return 1-cos(angle);
}
void display(void)
{
double t, p=3.141593/180;
glClear(GL_COLOR_BUFFER_BIT);
//glColor3f(1.0,0.0,0.0);
glColor3ub(0,0,255);
glBegin(GL_POINTS);
for(int i=0; i<360; i+=1){
t=i*p;
glVertex2f(r(t)*cos(t), r(t)*sin(t));
std::cout<
glVertex2f(399.4, -0.5);
glEnd();
glFlush();
}
void display2()
{
double t, p=3.141593/180;
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0,1.0,0.0);
glLineWidth(2);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
glBegin(GL_LINE_LOOP);
for(int i=0; i<360; i+=1){
t=i*p;
glVertex2f(r(t)*cos(t), r(t)*sin(t));
}
glVertex2f(399.4, -0.5);
glEnd();
glFlush();
}
void main(int argc, char**argv)
{
glutInit(&argc, argv);
// glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);
glutInitWindowSize(400,300);
glutInitWindowPosition(200,100);
glutCreateWindow("sample Prog: Points by irap123.com");
glClearColor(0.0,0.0,0.0,0.0);
gluOrtho2D(-2.0, 2.0,-1.5,1.5);
//gluOrtho2D(-10.0, 10.0, -10, 10);
glutDisplayFunc(display2);
glutMainLoop();
}
No comments:
Post a Comment