Smooth List Scroll

Nibbie
Posts: 1
Joined: 2009.07
Post: #1
Hi,
I am doing the scrolling of the image-lists 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
Quote this message in a reply
Member
Posts: 35
Joined: 2009.01
Post: #2
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, .. );
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Line Smooth Problem on iPhone Device abelix 1 3,984 Sep 22, 2010 06:28 AM
Last Post: Skorche
  How can I smooth accelerometer signal? riruilo 6 8,318 Feb 10, 2009 04:53 PM
Last Post: riruilo