title: Android ViewGroup Rotation in 3d
body: <p>I want to rotate my own FrameLayout in 3d in android. Do i have to use GlSurfaceView class. I am new in computer graphics but know the theory behind the rotations and translations. In order to make 3d opengl rotations we do the followings generally.</p>
  
  <p>In activity class we create a GLSurfaceView object and set its renderer. Renderer object is created from a class which implements GlSurfaceView.Renderer interface.</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      GLSurfaceView view = new GLSurfaceView(this);
      view.setRenderer(new OpenGLRenderer());
      setContentView(view);
  }
  </code></pre>
  
  <p>In our Renderer class we make the drawings, rotations and translations with following methods</p>
  
  <pre><code>// Called when the surface is created or recreated.
  public void onSurfaceCreated(GL10 gl, EGLConfig config) 
  
  // Called to draw the current frame.
  public void onDrawFrame(GL10 gl)
  
  // Called when the surface changed size.
  public void onSurfaceChanged(GL10 gl, int width, int height)
  </code></pre>
  
  <p>However i have a custom framelayout which is declared as</p>
  
  <pre><code>public class RotatedMapView extends FrameLayout
  </code></pre>
  
  <p>I want to make this : </p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      RotatedMapView  view = new RotatedMapView (this);
      view.setRenderer(new OpenGLRenderer());
      setContentView(view);
  }
  </code></pre>
  
  <p>But i can't, because setRenderer is special for GlSurfaceView. I am now browsing the GlSurfaceView.java source code in order to adapt it to my design. The link i found for GlSurfaceVİew.java is <a href="http://code.google.com/p/apps-for-android/source/browse/trunk/SpriteMethodTest/src/com/android/spritemethodtest/GLSurfaceView.java?r=150" rel="nofollow">http://code.google.com/p/apps-for-android/source/browse/trunk/SpriteMethodTest/src/com/android/spritemethodtest/GLSurfaceView.java?r=150</a>
  The source is too long. In fact I am not lazy to read it but i want to be sure whether or not i am in correct way.</p>