[android-developers] TouchEvent - ACTION_UP after ~30 seconds
Hi, I need the user touching the screen for a long period of time, but approximately after 30 seconds there is an ACTION_UP event automatically. I tested on three devices and it always happen. To understand what I'm saying, just swype on your home screen (to switch home screens) but keep your finger touching the screen, you will see that after 30 seconds you will release the finger from the screen. Any idea how to solve this issue? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: TouchEvent - ACTION_UP after ~30 seconds
I found this: There is a setting in the touch IC that causes touches that stay in more or less the same place for extended periods of time to be calibrated out. That is the setting that is causing this ACTION_UP message to be sent if you press and hold for more than 20 seconds (20-30 seconds is our typical setting). The reason this feature exists is to allow for false touches to eventually be removed from the screen (false touches can be generated in a number of ways, most likely water on the screen during operation). There are many arguments for and against this type of behavior, but I can say that at this time we do not have a coherent system strategy to deal with this type of operation. There are no requirements that specify exactly how persistent touches should be handled and the implementations we have today are based on the individual products desired use case support . Is there any way to avoid this? Or to fool it? Thiago On Mon, Mar 7, 2011 at 12:23, Thiago Lopes Rosa thiago.r...@gmail.comwrote: Hi, I need the user touching the screen for a long period of time, but approximately after 30 seconds there is an ACTION_UP event automatically. I tested on three devices and it always happen. To understand what I'm saying, just swype on your home screen (to switch home screens) but keep your finger touching the screen, you will see that after 30 seconds you will release the finger from the screen. Any idea how to solve this issue? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: TouchEvent - ACTION_UP after ~30 seconds
It is for a game! =) Thiago On Mon, Mar 7, 2011 at 12:53, Kostya Vasilyev kmans...@gmail.com wrote: It just seems to me - as a user - like a strange requirement to have. I can't imagine holding my finger on the screen for 20 seconds or longer in order to use a program. Um, unless it's an application intended to prevent prison breaks :) -- Kostya 07.03.2011 18:48, Thiago Lopes Rosa пишет: I found this: There is a setting in the touch IC that causes touches that stay in more or less the same place for extended periods of time to be calibrated out. That is the setting that is causing this ACTION_UP message to be sent if you press and hold for more than 20 seconds (20-30 seconds is our typical setting). The reason this feature exists is to allow for false touches to eventually be removed from the screen (false touches can be generated in a number of ways, most likely water on the screen during operation). There are many arguments for and against this type of behavior, but I can say that at this time we do not have a coherent system strategy to deal with this type of operation. There are no requirements that specify exactly how persistent touches should be handled and the implementations we have today are based on the individual products desired use case support . Is there any way to avoid this? Or to fool it? Thiago On Mon, Mar 7, 2011 at 12:23, Thiago Lopes Rosa thiago.r...@gmail.comwrote: Hi, I need the user touching the screen for a long period of time, but approximately after 30 seconds there is an ACTION_UP event automatically. I tested on three devices and it always happen. To understand what I'm saying, just swype on your home screen (to switch home screens) but keep your finger touching the screen, you will see that after 30 seconds you will release the finger from the screen. Any idea how to solve this issue? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Kostya Vasilyev -- http://kmansoft.wordpress.com -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Android Optical Mouse
Hi, Does anyone know how the optical mouse (example: HTC Incredible) is mapped? Would it be a trackball? DPAD? Touch? Another key? Thanks! Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: OpenGL - 3D rotation from a 2D input
Lesson 48 ported to Java (still needs some OpenGL ES adjustments): http://www.java-tips.org/other-api-tips/jogl/arcball-rotation-nehe-tutorial-jogl-port.html Thiago On Tue, Sep 7, 2010 at 21:04, Thiago Lopes Rosa thiago.r...@gmail.comwrote: Thanks! =) Thiago On Tue, Sep 7, 2010 at 14:25, Robert Green rbgrn@gmail.com wrote: I was going to suggest doing what they outline in that lesson. In short - keep a rotation matrix for the current orientation of your cube. Process input and keep a rotation matrix that you apply the user input to, then multiply the cube matrix by and store the result as the cube matrix, then reset the input matrix to identity and start all over. For user-space Z input rotation, you can do it like they do in the pro 3D apps - with a little button that shows that rotation to the left and to the right. Still use the same method as above, though, and you will get very predictable, nice rotation on all axis. On Sep 7, 11:39 am, alan a...@birtles.org.uk wrote: your first stop for all opengl questions should be NeHe open gl lessons:http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=48 On Sep 6, 9:58 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: This is a 3D Minesweeper. Instead of searching mines on that rectangular field, you must search them on several 3D fields (8 in total) by looking in all faces/planes. So you must rotate the objects to see all sides. (search for: *3D Mines*) I got the idea about different movements for each axis, but I really wanted to use dragging for all axis. Thanks, Thiago On Mon, Sep 6, 2010 at 17:42, Droid rod...@gmail.com wrote: Suggest dragging for x, y and tapping for z axis movement. But its not clear exactly what your end-game is You could also use accelerometer for tipping (see Breakout Legend in the App in mkt) :) Droid On Sep 6, 7:04 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: Hi, I have a cube on the center of the screen and the user can rotate it using the touchscreen. The problem: For example, when I rotate the cube 180 degrees (vertical), the horizontal rotation gets inverted (i mean, when moving right the cube rotates left and vice-versa). The issue is that I'm using 2D coordinates (touchscreen) to rotate the 3D cube. I'm always rotating around the cube's X and Y axis and never around the Z axis. The question is: How do I calculate how much and which axis to rotate from a 2D coordinate input? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: OpenGL - 3D rotation from a 2D input
Thanks! =) Thiago On Tue, Sep 7, 2010 at 14:25, Robert Green rbgrn@gmail.com wrote: I was going to suggest doing what they outline in that lesson. In short - keep a rotation matrix for the current orientation of your cube. Process input and keep a rotation matrix that you apply the user input to, then multiply the cube matrix by and store the result as the cube matrix, then reset the input matrix to identity and start all over. For user-space Z input rotation, you can do it like they do in the pro 3D apps - with a little button that shows that rotation to the left and to the right. Still use the same method as above, though, and you will get very predictable, nice rotation on all axis. On Sep 7, 11:39 am, alan a...@birtles.org.uk wrote: your first stop for all opengl questions should be NeHe open gl lessons:http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=48 On Sep 6, 9:58 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: This is a 3D Minesweeper. Instead of searching mines on that rectangular field, you must search them on several 3D fields (8 in total) by looking in all faces/planes. So you must rotate the objects to see all sides. (search for: *3D Mines*) I got the idea about different movements for each axis, but I really wanted to use dragging for all axis. Thanks, Thiago On Mon, Sep 6, 2010 at 17:42, Droid rod...@gmail.com wrote: Suggest dragging for x, y and tapping for z axis movement. But its not clear exactly what your end-game is You could also use accelerometer for tipping (see Breakout Legend in the App in mkt) :) Droid On Sep 6, 7:04 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: Hi, I have a cube on the center of the screen and the user can rotate it using the touchscreen. The problem: For example, when I rotate the cube 180 degrees (vertical), the horizontal rotation gets inverted (i mean, when moving right the cube rotates left and vice-versa). The issue is that I'm using 2D coordinates (touchscreen) to rotate the 3D cube. I'm always rotating around the cube's X and Y axis and never around the Z axis. The question is: How do I calculate how much and which axis to rotate from a 2D coordinate input? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.comandroid-developers%2Bunsubs cr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] OpenGL - 3D rotation from a 2D input
Hi, I have a cube on the center of the screen and the user can rotate it using the touchscreen. The problem: For example, when I rotate the cube 180 degrees (vertical), the horizontal rotation gets inverted (i mean, when moving right the cube rotates left and vice-versa). The issue is that I'm using 2D coordinates (touchscreen) to rotate the 3D cube. I'm always rotating around the cube's X and Y axis and never around the Z axis. The question is: How do I calculate how much and which axis to rotate from a 2D coordinate input? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: OpenGL - 3D rotation from a 2D input
This is a 3D Minesweeper. Instead of searching mines on that rectangular field, you must search them on several 3D fields (8 in total) by looking in all faces/planes. So you must rotate the objects to see all sides. (search for: *3D Mines*) I got the idea about different movements for each axis, but I really wanted to use dragging for all axis. Thanks, Thiago On Mon, Sep 6, 2010 at 17:42, Droid rod...@gmail.com wrote: Suggest dragging for x, y and tapping for z axis movement. But its not clear exactly what your end-game is You could also use accelerometer for tipping (see Breakout Legend in the App in mkt) :) Droid On Sep 6, 7:04 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: Hi, I have a cube on the center of the screen and the user can rotate it using the touchscreen. The problem: For example, when I rotate the cube 180 degrees (vertical), the horizontal rotation gets inverted (i mean, when moving right the cube rotates left and vice-versa). The issue is that I'm using 2D coordinates (touchscreen) to rotate the 3D cube. I'm always rotating around the cube's X and Y axis and never around the Z axis. The question is: How do I calculate how much and which axis to rotate from a 2D coordinate input? Thanks, Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: OpenGL ES - Color Picking - Front/Back Buffer
Hi Robert, This is exactly what I wanted to avoid! lol! =) I don't have this math skills and as it is a simple game, I chose the color-picking techinique. Do you have any idea why the colored objects are being displayed? I always draw the textured objects at the end of the onDrawFrame function. Does it always swap buffers after this function or am I triggering something wrong before the end? Thanks, Thiago On Thu, Sep 2, 2010 at 21:21, Robert Green rbgrn@gmail.com wrote: Thiago, I'm going to answer by providing a totally different way to do your picking. If you separate the object models and the rendering into two different things, you can have it so that when it's time to pick, you get a ray into your world using glUnProject (assuming you have your own view transform matrix that you use) and run intersection tests of that ray against your models. I recommend doing a simple ray-sphere intersection test to see if the ray was in the area of the object and then test against the faces of the object itself or a convex hull surrounding it to get a more accurate idea. This, done optimally, will most likely outperform your current solution as it doesn't introduce a complete pipeline stall with 2 pass rendering (glReadPixels, clear, draw again)... If you're interested in doing it, just refer to 3D game math books for the matrix math involved and google around for a ray-sphere test to get started. Once you've got that working, there are algorithms for producing the hull around the object or if you're ok with bounding boxes, they tend to work alright and are easily constructed. On Sep 2, 2:50 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: Hi, I have a 3D game and I am using color-picking to know which object was selected. When the user touches the screen, I draw each object with a different color. Then I read the color where the user touched the screen to know which object was selected. After that I draw each object with their respective textures/colors. (everything done during one onDrawFrame pass) The problem is that sometimes the colored objects appear on the screen (~5% of the times the user touches the screen) and it is even worse on slower hardwares. This is my pseudo code: public void onDrawFrame(GL10 gl) { if (user touched the screen) { gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); // DRAW COLORED OBJECTS gl.glReadPixels(x, y, ..); // CHECK WHICH OBJECT WAS SELECTED gl.glColor4x(0x, 0x, 0x, 0x); } gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); // DRAW TEXTURED OBJECTS } As far as I understand, we always draw on the Back Buffer and only after we finish, it swaps to the Front Buffer and updates the screen. Is there anything wrong with the above code? Thanks! Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: OpenGL ES - Color Picking - Front/Back Buffer
I have a class called ScreenView that extends GLSurfaceView. I have another class called ScreenRenderer that implements GLSurfaceView.Renderer. On ScreenView constructor I do the following: screenRenderer = new ScreenRenderer(context); setRenderer(screenRenderer); On onTouchEvent (in ScreenView) I set a flag during ACTION_DOWN to know that the user touched the screen (first IF on my first e-mail). I don't have other threads running at this moment. Thanks, Thiago On Fri, Sep 3, 2010 at 14:38, Robert Green rbgrn@gmail.com wrote: Thiago, I would not expect to see those drawn. Your color/depth clear should take care of it. You're using a GLSurfaceView and drawing only in the renderer which is called by the view, right? I suppose I'd try a flush before the actual rendering pass but that shouldn't be necessary either. What is your thread configuration? Doing anything special there? On Sep 3, 11:33 am, Lance Nanek lna...@gmail.com wrote: Weird, even if the command queue filled up and some were sent to the hardware automatically, that shouldn't cause a buffer swap, which must have happened for you to see things in progress... On Sep 2, 3:50 pm, Thiago Lopes Rosa thiago.r...@gmail.com wrote: Hi, I have a 3D game and I am using color-picking to know which object was selected. When the user touches the screen, I draw each object with a different color. Then I read the color where the user touched the screen to know which object was selected. After that I draw each object with their respective textures/colors. (everything done during one onDrawFrame pass) The problem is that sometimes the colored objects appear on the screen (~5% of the times the user touches the screen) and it is even worse on slower hardwares. This is my pseudo code: public void onDrawFrame(GL10 gl) { if (user touched the screen) { gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); // DRAW COLORED OBJECTS gl.glReadPixels(x, y, ..); // CHECK WHICH OBJECT WAS SELECTED gl.glColor4x(0x, 0x, 0x, 0x); } gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); // DRAW TEXTURED OBJECTS } As far as I understand, we always draw on the Back Buffer and only after we finish, it swaps to the Front Buffer and updates the screen. Is there anything wrong with the above code? Thanks! Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] OpenGL ES - Color Picking - Front/Back Buffer
Hi, I have a 3D game and I am using color-picking to know which object was selected. When the user touches the screen, I draw each object with a different color. Then I read the color where the user touched the screen to know which object was selected. After that I draw each object with their respective textures/colors. (everything done during one onDrawFrame pass) The problem is that sometimes the colored objects appear on the screen (~5% of the times the user touches the screen) and it is even worse on slower hardwares. This is my pseudo code: public void onDrawFrame(GL10 gl) { if (user touched the screen) { gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); // DRAW COLORED OBJECTS gl.glReadPixels(x, y, ..); // CHECK WHICH OBJECT WAS SELECTED gl.glColor4x(0x, 0x, 0x, 0x); } gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); // DRAW TEXTURED OBJECTS } As far as I understand, we always draw on the Back Buffer and only after we finish, it swaps to the Front Buffer and updates the screen. Is there anything wrong with the above code? Thanks! Thiago -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en