Monday, April 21, 2014

Smileys - An animation

A round circular face with smiley type expressions of smile, sad, surprise and laugh which can be changed by a pop up which appears on right click. The smiling face rotates about the y axis.

This is a very simple project and can be implemented by the student on his own.

Snaps:





Here is the source.
On request i am posting the same file with comments here.
The modification that can be done is the face could be made to
1) rotate along x axis instead of y axis.
2) It is very difficult to rotate it along z axis as the eyes nose etc have to also rotate.
3) The face could be replaced with a hexagon.
4) There is flicker while rotation, it can be reduced somehow. Just don't understand what is causing it.

On another request i have modified slightly the code and now the background can be changed by the menu on right click. Smiley face is moving too. Here it is.

21 comments:

  1. sir can u please explain d code with comments

    ReplyDelete
    Replies
    1. Please see commented code posted above... also suggested some changes.

      Delete
  2. plz do mail me soon n suggest extra features which all can be added n send if u ve plz

    ReplyDelete
    Replies
    1. Bear with me... i don't have your mail address. Will work on commenting the code after 24th. Have my hands full with work till then.

      Delete
    2. sir can u plz do tl how to add translation fuction to dis program n change background colors fr each emoticon

      Delete
    3. Ya var in display function before drawing face try calling glTranslatef(); also u can set background color in glClearColor() in the menu handling function with appropriate color parameter.

      Delete
  3. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. sir please do mail me d changes i tried but gettin many errors
      plz do mail d code vt above changes as i askd to
      var70795@gmail.com

      Delete
  4. sir please can u add crying expression code for smiley ,my mail id is komalgpet123gmail.com

    ReplyDelete
    Replies
    1. Yes ...
      See in this code in function smile
      float rtheta,theta,r=90;
      do
      {
      glBegin(GL_POINTS);
      for(theta=45;theta<135;theta++)
      {
      rtheta=theta*3.142/180;
      glColor3f(0,0,0);
      glVertex3f(x+r*cos(rtheta),y+r*sin(rtheta),0);
      }
      glEnd();
      r=r+0.5;
      }while(r<92);
      and in sample function instead of calling smile(0,0); call smile(-125,-125);
      Revert to me back in case it does not work.

      Delete
  5. Dear Sir...pls tell me 1 thing...
    Are u still working for VTU syllabus..
    And may I knw the college in which u teach at present..

    ReplyDelete
    Replies
    1. I m in 2014 scheme (follows 2010 scheme) we r the last batch having CG subject...
      2015 onwards VTU assigned CBCS scheme for students by modifying the subjects ..
      They are (2015 batch) having latest syllabus..which consists of Java and Software Engineering in their 3rd n 4th sem itself... n we r yet to learn it in our next semester..😅

      Delete
  6. sir can u please apply keyboard function for start the rotation

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Sir plz send me report for this project.this is my email id prashanthkumar4585@gmail.com

    ReplyDelete
  9. Hi sir good afternoon....am Roja we have selected this project....actually we want report sir....sir please can u send me report for this project.....my mail id:roja.16hskp@gmail.com

    ReplyDelete