I’m creating a 2D game with OpenGL ES for Android.I want to perform a shake effect.
My idea is changing my camera’s y coordinate but i’m not sure about algorithm.I have a position vector with x and y variables for my camera class.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Looks like a duplicate of Opengl Real world Camera Shake algorithm . Essentially model the shaking after a Sin wave and modulate the amplitude depending on how much you want the camera to shake.
a really basic outline like below, you’ll need to stop this when amplitude hits 0 among other things..