Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
D

Deepak971

@Deepak971
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • the bellow code contains some logical errors.in this code food(),poison food() functions will only work at once after execution . .please help me to correct this.
    D Deepak971

    #include<stdio.h>
    #include<stdlib.h>
    #include<GL/glut.h>
    #include<math.h>
    #include<windows.h>
    int flag=0,ch=0,ch1=0;
    float a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,p=0,q=0,s=0.7,x=0,y=0;
    void create_menu(void);
    void menu(int);
    void disp1(void);
    void disp2(void);
    void disp3(void);
    void disp4(void);

    void delay(int time)
    {
    float i,j,k;

    for(i=0;i<time;i=i+0.001);
    for(j=0;j<time;j=j+0.001);
    for(k=0;k<time;k=k+0.001);
    

    }

    void fish1()
    {
    glColor3f(1.0,0.0,0.0);//red fish
    glBegin(GL_POLYGON);
    glVertex2f(0.7+a,0.05);

    glVertex2f(0.75+a,0.1);

    glVertex2f(0.85+a,0.05);
    glVertex2f(0.75+a,0.0);
    glEnd();

    glBegin(GL_TRIANGLES);
    glColor3f(1.0,0.0,0.0);
    glVertex2f(0.83+a,0.05);
    glColor3f(1.0,1.0,0.0);
    glVertex2f(0.9+a,0.09);
    glVertex2f(0.9+a,0.01);
    glEnd();

    glBegin(GL_TRIANGLES);
    glColor3f(1.0,1.0,0.0);
    glVertex2f(0.75+a,0.095);
    glColor3f(1.0,0.0,0.0);
    glVertex2f(0.79+a,0.125);
    glVertex2f(0.77+a,0.07);
    glEnd();

    glBegin(GL_TRIANGLES);
    glColor3f(1.0,1.0,0.0);
    glVertex2f(0.75+a,0.007);
    glColor3f(1.0,0.0,0.0);
    glVertex2f(0.795+a,-0.035);
    glVertex2f(0.77+a,0.02);
    glEnd();

    glColor3f(0.0,0.0,0.0);
    glPointSize(4.0);
    glBegin(GL_POINTS);
    glVertex2f(0.73+a,0.065);
    glEnd();

    }

    void fish11()
    {

    glColor3f(1.0,0.0,0.0);//red fish
    glBegin(GL_POLYGON);
    glVertex2f(-0.7,0.05);
    glVertex2f(-0.75,0.1);
    glVertex2f(-0.85,0.05);
    glVertex2f(-0.75,0.0);
    glEnd();

    glBegin(GL_TRIANGLES);
    glVertex2f(-0.83,0.05);
    glVertex2f(-0.9,0.09);
    glVertex2f(-0.9,0.01);
    glEnd();

    glBegin(GL_TRIANGLES);
    glVertex2f(-0.75,0.095);
    glVertex2f(-0.79,0.125);
    glVertex2f(-0.77,0.07);
    glEnd();

    glBegin(GL_TRIANGLES);
    glVertex2f(-0.75,0.007);
    glVertex2f(-0.795,-0.035);
    glVertex2f(-0.77,0.02);
    glEnd();

    glColor3f(0.0,0.0,0.0);
    glPointSize(4.0);
    glBegin(GL_POINTS);
    glVertex2f(-0.73,0.065);
    glEnd();
    }

    void fish2()
    {
    glColor3f(1.0,1.0,0.0);//yellow fish
    glBegin(GL_POLYGON);
    glVertex2f(-0.7-b,-0.05);
    glVertex2f(-0.75-b,-0.1);
    glVertex2f(-0.85-b,-0.05);
    glVertex2f(-0.75-b,0.0);
    glEnd();

    glBegin(GL_TRIANGLES);
    glColor3f(0.8,0.5,0.0);
    glVertex2f(-0.83-b,-0.05);
    glVertex2f(-0.9-b,-0.09);
    glVertex2f(-0.9-b,-0.01);
    glEnd();

    glBegin(GL_TRIANGLES);
    glColor3f(0.8,0.5,0.0);
    glVertex2f(-0.75-b,

    Graphics help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups