• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Open GL  Animation
 

Open GL Animation

on

  • 4,577 views

 

Statistics

Views

Total Views
4,577
Views on SlideShare
4,330
Embed Views
247

Actions

Likes
1
Downloads
51
Comments
0

7 Embeds 247

http://civil-dusk.blogspot.com 214
http://www.blogger.com 17
http://civil-dusk.blogspot.de 8
http://civil-dusk.blogspot.in 3
http://www.linkedin.com 3
http://civil-dusk.blogspot.co.uk 1
http://civil-dusk.blogspot.it 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Open GL  Animation Open GL Animation Presentation Transcript

    • Presented By: Kiran Munir 08-SE-59
      • 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
      • For animation
        • We can explicitly force the display callback to be invoked by issuing the command glutPostRedisplay() .
      • For automated simulation
        • We need a mechanism for the window to be continually updated automatically.
        • Idle Callback ( glutIdleFunc() )
        • Timer Callback ( glutTimerFunc() ).
      • 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.
    • A Simple Animation
    •  
      • float X=0.0;
      • float deltaX=0.01;
      • 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(); }
    •  
        • Single Buffer Rendering
        • Hardware Dependence
          • Inconsistent speed
    • A Smooth Animation
    •  
    •  
    •  
    •  
    •  
    •  
      • 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.
        • No real solution
        • Make faster computers slow
        • Important for consistency
      • Animation Delay
        • Select the minimal hardware configuration
        • Set a time delay for animation
      • Glut Timed Callback
        • GlutTimerFunc();
      • glutTimerFunc(time,function,arg)
        • This causes function() to be called after time milliseconds with arg as an argument to function()
      • void Timer(int unused)
      • {
      • glutPostRedisplay();
      • glutTimerFunc(30,Timer,0);
      • }
    •  
      • 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.
    •  
      • http://xoax.net/
      • http://nehe.gamedev.net
    •