views:

129

answers:

1

Hi, I would like to scroll an object in my iPhone Screen. I am using OpenGL ES. It is not like a background scrolling that occurs in a game. It is just like, when the user touches it and scrolls when he/she wants to. Can someone please tell me how to do it?

Thanks :)

A: 

Scrolling itself is just done by moving your camera position. Are you using a call like gluLookAt()? It's not a built in function, but it is in regular OpenGL. A quick Google will turn up a sample implementation.

Assuming you are doing this, you need to figure out where / when your camera is moving. You'll need to handle touches from the user, track any movement and apply a similar movement to your camera's position. I can't give a more specific answer without knowing more about how you are setting up your camera, is it a perspective or orthographic projection etc.

George Sealy
Thank you very much :). It is an orthographic projection.It is going to be just like a slot machine, where the user move the reels up and down by swiping up and down and then can choose a number.I have no code as of now, otherwise I would have pasted it here :)
Felix