Namratha and sweekruthi worked on this existing project. The modification done to the sinking ship project that has been done is the ice berg becomes two pieces... both the pieces move down and sink.
Here are the snaps:
Moving....
Collison....
Pieces of iceberg and ship sinking....
I just want to add something to explain how this pieces of ice cube and their rotation was achieved.
Here is the code which does the trick.
/* TO DRAW ICEBERG */
void ice()
{
glPushMatrix();
glTranslated(450,50,0.0);
glScaled(10,10,0);
glColor3f(0.0,1.0,1.0);
if(c>0) // This flag is used to indicate if ice berg is
{glPushMatrix(); // intact or split into two after collision
glTranslated(0,x,0); //move the ice bergs down all the while rotating them.
glPushMatrix();
glTranslated(7,2,0.0);
glRotated(-x,0,0,1); // clockwise for the right piece.
glTranslated(-7,-2,0.0);
glBegin(GL_POLYGON);
glVertex2f(7,2);
glVertex2f(8,3);
glVertex2f(11,18);
glVertex2f(12,19);
glVertex2f(12,3);
glEnd();
glPopMatrix();
glPushMatrix();
glTranslated(12,3,0.0);
glRotated(x,0,0,1); // anti clock wise for the left piece.
glTranslated(-12,-3,0.0);
glBegin(GL_POLYGON);
glVertex2f(12,3);
glVertex2f(12,19);
glVertex2f(17,18);
glVertex2f(18,3);
glVertex2f(19,3);
glEnd();
glPopMatrix();
glPopMatrix();
}
else // if ice berg is intact draw one piece
{ // without any transformations
glBegin(GL_POLYGON);
glVertex2f(7,2);
glVertex2f(8,3);
glVertex2f(11,18);
glVertex2f(12,19);
glVertex2f(12,3);
glEnd();
glBegin(GL_POLYGON);
glVertex2f(12,3);
glVertex2f(12,19);
glVertex2f(17,18);
glVertex2f(18,3);
glVertex2f(19,3);
glEnd();
}
glPopMatrix();
}
The variable c is global and it is set in the display function
like this...
if(b>250)
{
c+=10;
display3();
}
Here is the complete code.
Here are the snaps:
Moving....
Collison....
Pieces of iceberg and ship sinking....
I just want to add something to explain how this pieces of ice cube and their rotation was achieved.
Here is the code which does the trick.
/* TO DRAW ICEBERG */
void ice()
{
glPushMatrix();
glTranslated(450,50,0.0);
glScaled(10,10,0);
glColor3f(0.0,1.0,1.0);
if(c>0) // This flag is used to indicate if ice berg is
{glPushMatrix(); // intact or split into two after collision
glTranslated(0,x,0); //move the ice bergs down all the while rotating them.
glPushMatrix();
glTranslated(7,2,0.0);
glRotated(-x,0,0,1); // clockwise for the right piece.
glTranslated(-7,-2,0.0);
glBegin(GL_POLYGON);
glVertex2f(7,2);
glVertex2f(8,3);
glVertex2f(11,18);
glVertex2f(12,19);
glVertex2f(12,3);
glEnd();
glPopMatrix();
glPushMatrix();
glTranslated(12,3,0.0);
glRotated(x,0,0,1); // anti clock wise for the left piece.
glTranslated(-12,-3,0.0);
glBegin(GL_POLYGON);
glVertex2f(12,3);
glVertex2f(12,19);
glVertex2f(17,18);
glVertex2f(18,3);
glVertex2f(19,3);
glEnd();
glPopMatrix();
glPopMatrix();
}
else // if ice berg is intact draw one piece
{ // without any transformations
glBegin(GL_POLYGON);
glVertex2f(7,2);
glVertex2f(8,3);
glVertex2f(11,18);
glVertex2f(12,19);
glVertex2f(12,3);
glEnd();
glBegin(GL_POLYGON);
glVertex2f(12,3);
glVertex2f(12,19);
glVertex2f(17,18);
glVertex2f(18,3);
glVertex2f(19,3);
glEnd();
}
glPopMatrix();
}
The variable c is global and it is set in the display function
like this...
if(b>250)
{
c+=10;
display3();
}
Here is the complete code.
hello sir...could u please send me the project reports of this sinking ship project to d mail id 'sushmitha.b16@gmail.com'?
ReplyDeleteCould u send me project report of sinking ship to dis email ID :amilineniniveditha@gmail.com.. Plz bro 🙏
DeleteSend me sinking ship project report plzz
DeletePlease could u send me the report sir ??of thinking ship to poorna929@gmail.
ReplyDeleteCom
Sir could you please send the report to mohankumari.venugopal@gmail.com
ReplyDeleteship.c:49:8: warning: implicit declaration of function ‘nanosleep’ [-Wimplicit-function-declaration]
ReplyDeletenanosleep(&tim , &tim2);
can anyone send me the flow chart diagram of this project?
ReplyDeletesend me the same to abhimanyurex@gmail.com
Can you please send me the project report for this?
ReplyDeleteMy email ID: faran.baig.95@gmail.com
Thank you!
Can you please send me the project report for this?
ReplyDeleteMy email ID: faran.baig.95@gmail.com
Thank you!
This comment has been removed by the author.
ReplyDeletesir plz send me the report of this project sir...plzz sir
ReplyDeletevishweshwarayya.hiremath17@gmail.com
Bro you have source code if there send to chethup98@gmail.com plz
ReplyDeleteCan you please send me project report for this my email id yasmeentaj40@gmail.com
ReplyDeleteCould you please send me project report to dis email :amilineniniveditha@gmail.com
DeleteThis comment has been removed by the author.
ReplyDeleteSir plz send me pdf file
ReplyDeleteSir can you please send the report pdf to my mail
ReplyDeleteSir if u hv report pdf plzz forward to my mail id kmanasa199@gmail.com
DeleteSir could you please send me the report of this project to rakshashetty659@icloud.com
ReplyDeleteSir can you plzz send me the report of this project to mamathark9@gmail.com
ReplyDeletesir can u plz send me full code to ishrathaysha111@gmail.com
ReplyDeleteSir.. Could u please send me the project report of sinking ship project to the mail mahalakshmishetty06@gmail.com
ReplyDeleteWe need full code
ReplyDeleteSir please can you send project report on email sir (sagar8910hunashyal@gmail.com) please.
ReplyDeleteCould you please send me a project report plz bro.
DeleteSir can u please help me in adding user interaction keys to this progrwm
ReplyDeleteCould you please send me the project source code and report
ReplyDeleteCould you please send me a project report plz bro to dis email :amilineniniveditha@gmail.com..🙏🙏
ReplyDeleteSorry I could not respond as I have lost all backup of reports due to hard disk crash. If not for my gdrive I would have lost the code too.
DeleteSend me report of sinking ship
ReplyDelete