Marco Martinelli
Reputation
421
Top tag
Next privilege 500 Rep.
Access review queues
 Mar 3 awarded Yearling Mar 3 answered OpenGL ES 2 inheriting issues Mar 3 answered AI multithreading Feb 6 awarded Informed Sep 23 awarded Yearling Jun 24 awarded Autobiographer Jun 19 awarded Caucus Jun 19 awarded Constituent Feb 19 awarded Fanatic Nov 16 revised sprite animation in openGL edited body Nov 2 comment Passing elapsed time to the update function from the game loop @Marton thank you, I didn't know that. I've deleted my comment. Oct 31 awarded Critic Oct 22 awarded Enthusiast Oct 15 answered Sprite Animation in Android with OpenGL ES Oct 15 comment Sprite Animation in Android with OpenGL ES You can find the answer here: gamedev.stackexchange.com/questions/37510/… Oct 3 revised Rotate triangle so that its tip points in the direction of the point on the screen that we last touched added 12 characters in body Oct 3 comment Rotate triangle so that its tip points in the direction of the point on the screen that we last touched it is the same result as before or a different one? Oct 3 comment Rotate triangle so that its tip points in the direction of the point on the screen that we last touched Your problem is normal because you are still using `touchPos.x = (2*event.getX())/getWidth() -1.0f;` but as I've said before you should write `touchPos.x = (2*event.getX())/getWidth() -1.0f -mx;` and -my in touchPos.y Oct 2 comment Rotate triangle so that its tip points in the direction of the point on the screen that we last touched Can you update the SurfaceView code? Oct 2 comment Rotate triangle so that its tip points in the direction of the point on the screen that we last touched well, think about it. `event.getX()` goes from 0 to the value of `getWidth()` so `event.getX()/getWidth()` goes from 0 to 1. These is a 2* so the range is from 0 to 2 but your coordinates goes from -1 to 1 so subtract 1 and that's all. By the way, I was assuming that the center of the screen is (0,0)