Created
April 14, 2016 13:22
-
-
Save framundo/41b7a7c0cbf1e9530d23a73c423edebe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ExampleFragment extends Fragment { | |
| private EasyGLView mEasyGLView; | |
| private BasicGLRenderer mBasicRenderer; | |
| @Nullable | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
| ViewGroup viewGroup = (ViewGroup) inflater.inflate(R.layout.fragment_example, container, false); | |
| mEasyGLView = (EasyGLView) viewGroup.findViewById(R.id.easygl); | |
| setupWorld(); | |
| return viewGroup; | |
| } | |
| private void setupWorld() { | |
| GLCameraOptions glCameraOptions = new GLCameraOptions() | |
| .setEye(0, 0, -3.0f) | |
| .setUp(0, 1.0f, 0) | |
| .setDepthRange(0.5f, 100.0f); | |
| mBasicRenderer = new BasicGLRenderer(glCameraOptions); | |
| mBasicRenderer.setBackgroundColor(Color.BLUE); | |
| mEasyGLView.setRenderer(mBasicRenderer); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment