Jump to content
  • Advertisement
Sign in to follow this  
AhmedAndre

OpenGL Opengles on Android Question

This topic is 2926 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I would like to render a book and flip the pages .. so I tried to draw a quad using four vertices , how can I bend the the quad ? is it possible to do vertex teweening ??

Share this post


Link to post
Share on other sites
Advertisement
If you just want the page to flip over, stiff and unnaturally, you can just change two of the vertices at some specific rate so the quad flips from one side to the other. If you take this path, you'll need to ensure you flip the page based upon some rate of time, and not a number of frames, because the performance of Android devices varies.

If you want it the page to have a slight curve in it, you'll need more vertices, and you'll probably be better off creating an animated model for it rather than trying to hard code it.

Share this post


Link to post
Share on other sites
How about animated model ?
It should bend based on the sliding of my hand ?
how can I do that ??
For example If I move slightly to left the page should bend more, how can I do that using animated model ?

Share this post


Link to post
Share on other sites
Make an animation from start to finish, but when you play it back, stop it at some arbitrary point. Which point is down to you to experiment with and work out.

Maybe write a drag detector and work out how far the guy has dragged his finger as a proportion of how long you want him to, and stop at that percentage through the animation.

Add more realism by detecting the sidewaysness of this and if hes dragging mainly left then roll the animation onwards, but if he's dragging right, then roll it back toward the beginning by a suitable amount.

I suggest ignoring the animation part and just rendering a little expanding rectangle (like a scroll bar). Get that working how you feel it should, imagining the scrollbar to be pages in your animation. When it works nice, add the animation code instead of the bar.

In fact you can think of the user dragging his finger on a windows style scrollbar to control the animation. If the scrollbar is horizontal and fills the screen (yes, a massive scroll bar) then that's what you're trying to emulate.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!