Your SlideShare is downloading. ×
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Open GL  Animation
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Open GL Animation

5,151

Published on

Published in: Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,151
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
78
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Presented By: Kiran Munir 08-SE-59
  • 2.
    • Animation is the rapid display of a sequence of images of 2-D or 3-D artwork or model positions in order to create an illusion of movement.
    • "Animation" would be the technique of giving "soul" to objects and drawings
  • 3.
    • For animation
      • We can explicitly force the display callback to be invoked by issuing the command glutPostRedisplay() .
  • 4.
    • For automated simulation
      • We need a mechanism for the window to be continually updated automatically.
      • Idle Callback ( glutIdleFunc() )
      • Timer Callback ( glutTimerFunc() ).
  • 5.
    • The Idle Callback specifies a function that is invoked whenever the system is not handling any other callbacks or events.
    • Timer Callback specifies a function that is invoked after a specified time period.
  • 6. A Simple Animation
  • 7.  
  • 8.
    • float X=0.0;
    • float deltaX=0.01;
  • 9.
    • Void draw(void)
    • {
    • glClear (GL_COLOR_BUFFER_BIT);
    • glBegin (GL_LINES);
    • glVertex3f ( X, 0.25,0.0);
    • glVertex3f ( 1.0-X , 0.75,0.0);
    • glEnd ( );
    • glFlush ();
    • X+=deltaX;
    • if(X>=1.0 || X<=0.0){
    • deltaX=-deltaX;
    • }
    • glutPostRedisplay(); }
  • 10.  
  • 11.
      • Single Buffer Rendering
      • Hardware Dependence
        • Inconsistent speed
  • 12. A Smooth Animation
  • 13.  
  • 14.  
  • 15.  
  • 16.  
  • 17.  
  • 18.  
  • 19.
    • Now to compile and execute we see a smooth animated line segment
    • Double buffering is insignificant In this case, but is important in drawing complex scenes.
  • 20.
      • No real solution
      • Make faster computers slow
      • Important for consistency
  • 21.
    • Animation Delay
      • Select the minimal hardware configuration
      • Set a time delay for animation
  • 22.
    • Glut Timed Callback
      • GlutTimerFunc();
  • 23.
    • glutTimerFunc(time,function,arg)
      • This causes function() to be called after time milliseconds with arg as an argument to function()
  • 24.
    • void Timer(int unused)
    • {
    • glutPostRedisplay();
    • glutTimerFunc(30,Timer,0);
    • }
  • 25.  
  • 26.
    • At the end of 30 milliseconds the function timer is called again and dispatches the redisplay and timer messages.
    • To compile and execute the program we see a much smoother animation.
    • Simultaneously running applications can slow down your animation.
  • 27.  
  • 28.
    • http://xoax.net/
    • http://nehe.gamedev.net
  • 29.  

×