NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#include<iostream>
#include <GL/glut.h>
#include <string.h>
#include <math.h>
#include <cstdlib>
#include<conio.h>
#include<windows.h>
#include<time.h>


#define WIDTH 700
#define HEIGHT 600
int timeSinceStart = glutGet(GLUT_ELAPSED_TIME);
int oldTimeSinceStart = 0;
using namespace std;
float pos = 0;
float pos1 = 0;
int b = 0;
bool dir = true;
bool cizdir = false;
float sc = rand() % 2,m=10,n=10;
double arr[5000][4];
double kurt1[5000][4];
float x1 = 100, x2 = 150, x3 = 190;
float s1 = 200, s2 = 220, s3 = 230;
int z = 0, q = 10, w = 10;
int i, a = 0;
int flag = 0;
float radius = 0.03;
int ptr = 0, str = 0;
int faltu_bit = 1;
float color[3][3] = { { 1.0, 1.0, 1.0 }, { 1.0, 1.0, 0.0 }, { 0.0, 1.0, 0.0 } };

void drawText(char *str, float x, float y, int id)
{
int i;
int len = strlen(str);
//glLoadIdentity();
glColor3f(color[id][0], color[id][1], color[id][2]);
glRasterPos2f(x, y);
for (i = 0; i<len; i++)

glutBitmapCharacter(GLUT_BITMAP_TIMES_ROMAN_24, str[i]);

}


void init()
{
glClearColor(0.0, 0.0, 0.0, 1.0);
glMatrixMode(GL_PROJECTION);
gluOrtho2D(0.0, WIDTH, 0.0, HEIGHT);
memset(arr, 0, 5000);

glPointSize(20);

}



///OPENGL MAPPING///
float getOpenGLX(int x)
{
double ox = x / (double)WIDTH*(WIDTH);
return ox;
}

float getOpenGLY(int y)
{
double oy = (1 - y / (double)HEIGHT)*HEIGHT;
return oy;
}




void drawBall(float x, float y)
{
glBegin(GL_POINTS);
glColor3f(1.0, 1.0, 0.0);
glVertex2f(x, y);

glEnd();
}
void kurt(float m,float n)

{

glBegin(GL_POINTS);
glColor3f(1.0, 1.0, 0.0);
glVertex2f(m, n);

glEnd();
}

void agil()
{
glColor3f(0.0f, 1.0f, 0.0f);
glRectf(600, 0, 700, 600);
drawText("AGIL", 620, 300, 1);
}

void draw()

{




glBegin(GL_POINTS);

glColor3f(1.0, 1.0, 0.0);
glVertex2f(x1, s1);
glColor3f(1.0, 1.0, 0.0);
glVertex2f(x2, s2);

glEnd();






//1.koyun


}

void drawLine(int start)
{
glBegin(GL_LINE_STRIP);
glColor3f(1.0, 0.0, 0.0);
for (int i = start; i<z; i++)
{
glVertex2f(arr[i][0], arr[i][1]);

}
glEnd();
}




void addValue(int x, int y)
{



arr[z][0] = getOpenGLX(x);
arr[z++][1] = getOpenGLY(y);




}





void myDisplay()
{
glClear(GL_COLOR_BUFFER_BIT);

draw();
drawLine(ptr);
kurt(m,n);
agil();
drawBall(arr[ptr][0], arr[ptr][1]);
glutSwapBuffers();
glutPostRedisplay();


glFlush();
}


void myMouseStat(int button, int state, int x, int y)
{
if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
{
if (!flag)
{
cizdir = true;
flag = 1;
}
}
else if (button == GLUT_LEFT_BUTTON && state == GLUT_UP)
{
if (flag)
{

flag = 0;
}
}

}


void myPressedMove(int x, int y)
{
if (flag)
{
addValue(x, y);
}
}


void myTimer(int t)
{
int sayac= 120;
if (ptr != z - 1)
{



str++;
ptr++;
a++;
m++;






}




glutTimerFunc(55, myTimer, 0);

}

int main(int argc, char ** argv)
{
int oldTimeSinceStart = 0;

glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);
glutInitWindowPosition(100, 100);
glutInitWindowSize(WIDTH, HEIGHT);
glutCreateWindow("KoyunKurtarma");
init();
int timeSinceStart = glutGet(GLUT_ELAPSED_TIME);
int deltaTime = timeSinceStart - oldTimeSinceStart;


glutDisplayFunc(myDisplay);

glutMouseFunc(myMouseStat);
glutMotionFunc(myPressedMove);
glutTimerFunc(55, myTimer, 0);

glutMainLoop();
return 0;
}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.