This is a proof-of-concept (P.O.C.) for rendering OpenGL world by using the phone's Orientation Sensor as an input. First I'll draw a crate in 3D space, then I'll set the camera (View Point) to look at it. whenever a user look away (roll/pitch/yaw) the crate, it will disappear from screen until the user point the phone back to that direction. here's an illustration of what I mean: code segments: public class GLSurfaceViewActivity extends Activity implements SensorEventListener{ @Override protected void onCreate(Bundle savedInstanceState) {  super.onCreate(savedInstanceState);  // ...  // --- init sensor ---  mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE);  sensorList = mSensorManager.getSensorList(Sensor.TYPE_ORIENTATION);  orientationSensor = sensorList.get(0);  // ...  mSensorManager.registerListener(this,  orientationSensor,SensorManager.SENSOR_DELAY_FASTEST);  }  /**    *    **/  public void onSensorChanged(SensorEvent event){   if (event.sensor ==...
 
Comments
Post a Comment