On Thu, Jul 5, 2012 at 12:47 PM, santy wrote: > Yes, of course I have been trying with all the frameworks I have found > (LooakAR, min3D...) and I am sure I can do what I need with them but I > don´t know how. I wrote here in order to find someone who has done exactly > the same I have to do (there must be a lot) and to know how they did it (I > need a tutorial that explains it or some advices). > > Thanks > > > El jueves, 5 de julio de 2012 19:40:21 UTC+2, Nobu Games escribió: >> https://www.google.com/search?q=Android+Augmented+Reality > > You need to make use of SensorManager and register a SensorListener in order to construct a device rotation matrix. Luckily Android already provides a method that calculates that matrix which is ready for use in OpenGL:
SensorManager.getRotationMatrix()<http://developer.android.com/reference/android/hardware/SensorManager.html#getRotationMatrix%28float[],%20float[],%20float[],%20float[]%29> . *This matrix is ready to be used by OpenGL ES's glLoadMatrixf(float[], int)<http://developer.android.com/reference/javax/microedition/khronos/opengles/GL10.html#glLoadMatrixf%28float[],%20int%29>. > * > > * Note that because OpenGL matrices are column-major matrices you must > transpose the matrix before using it. However, since the matrix is a > rotation matrix, its transpose is also its inverse, conveniently, it is > often the inverse of the rotation that is needed for rendering; it can > therefore be used with OpenGL ES directly. * > You also may want to implement an algorithm that reduces the noise from the sensor data, otherwise the 3D objects will jitter on the screen. The simplest approach is calculating a median and / or weighted average over time. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

