Smooth List Scroll
Hi,
I am doing the scrolling of the imagelists in Opengl.
I have done the scrolling by translating with textures.
But there is jerk on translation.
It want to make it smooth and fast.
Please let me know any efficient way to implement the smooth scroll.
Thanks,
Arun AC
I am doing the scrolling of the imagelists in Opengl.
I have done the scrolling by translating with textures.
But there is jerk on translation.
It want to make it smooth and fast.
Please let me know any efficient way to implement the smooth scroll.
Thanks,
Arun AC
Try this.
Code:
// assume x1, x2, y1, y2, t, and scrollTime are defined above
// where t = {0..scrollTime}
GLfloat dx = x2  x1;
GLfloat dy = y2  y1;
// take a look at a graph of the equation y = .5  .5 * cos( Ï€ * x )
GLfloat smoothingFactor = .5  .5 * cos(Ï€ * t / scrollTime);
GLfloat x = x1 + smoothingFactor * dx;
GLfloat y = y1 + smoothingFactor * dy;
glTranslatef( x, y, .. );
Possibly Related Threads...
Thread:  Author  Replies:  Views:  Last Post  
Line Smooth Problem on iPhone Device  abelix  1  5,136 
Sep 22, 2010 06:28 AM Last Post: Skorche 

How can I smooth accelerometer signal?  riruilo  6  11,218 
Feb 10, 2009 04:53 PM Last Post: riruilo 