Articles about OpenGL ES’

Mar 26, 2012

Rajawali Tutorial 13: Animation classes

Posted by Dennis in 3D, Android, Rajawali 13 comments

A couple of animation classes have been added to the framework. They resemble Android’s View animation classes but they’re not 100% the same. Here’s an overview of the new classes: Animation3DQueue: a sequence of animations RotateAnimation: rotate an object around its axis ScaleAnimation: scale an object TranslateAnimation: translate an object RotateAroundAnimation: rotate an object around [...]


Mar 23, 2012

Rajawali Tutorial 12: Object Picking

Posted by Dennis in 3D, Android, Rajawali 7 comments

Here’s how to do object picking. First make sure your activity implements OnTouchListener. Then register the listener and override the onTouch method: public class MyActivity extends RajawaliActivity implements OnTouchListener { … @Override public void onCreate(Bundle savedInstanceState) { … mSurfaceView.setOnTouchListener(this); } @Override public boolean onTouch(View v, MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN) { // this needs [...]


Feb 27, 2012

Rajawali Tutorial 11: A Better, Faster Particle System

Posted by Dennis in 3D, Android, Rajawali 9 comments

In the previous tutorial I explained how you can set up a simple particle system. It worked, but the performance is pretty horrible. For each particle a separate Particle instance was created which consumes a lot of system resources. In this tutorial we’ll instantiate the Particle class to create a particle system (I know, this [...]


Feb 27, 2012

Rajawali Examples on Github & Android Market

Posted by Dennis in 3D, Android, Rajawali No comments

I’ve just created a new Github repository which is a collection of examples that show how to use the different features of the Rajawali engine. Check it out! The examples app is also on the Android Market. Download it here for free.


Feb 23, 2012

Rajawali Tutorial 10: Simple Particle System

Posted by Dennis in 3D, Android, Rajawali 2 comments

Check Rajawali Tutorial 11: A Better, Faster Particle System for a better way of doing this.


Feb 22, 2012

Rajawali Tutorial 9: 2D Renderer

Posted by Dennis in 3D, Android, Rajawali 7 comments

I got a very nice surprise in my Github inbox today. Christoffer Green has added a 2D renderer to Rajawali! This means that you can add a 2D camera to the scene, add a plane (width 1, height 1) and then add a custom material to it and do some GLSL 2D funkiness. To demonstrate [...]


Feb 22, 2012

Rajawali Tutorial 8: More About The Initialization Phase & Lost Textures

Posted by Dennis in 3D, Android, Rajawali 6 comments

This is done automatically now. Scene construction should be done in the initScene() method. Resources are managed by the framework. Rajawali Tutorial 9: 2D Renderer There’s a slight optimization that can be done during the initialization phase. The construction of the 3D scene happens in the onSurfaceCreated() method. However, it is not necessary to re-create [...]


Feb 22, 2012

Rajawali Tutorial 7: Creating a Custom Material / GLSL Shader

Posted by Dennis in 3D, Android, Rajawali 6 comments

You can create your own materials quite easily. In this example we’ll create a new material based on the SimpleMaterial class. SimpleMaterial is the most basic material and doesn’t use any lights. We’ll create a custom material that uses a GLSL fragment shader for an old-school plasma effect. It’ll look like this: The first step [...]


Feb 17, 2012

Rajawali Tutorial 6: Adding User Interface Elements

Posted by Dennis in 3D, Android, Rajawali 9 comments

You can add user interface elements and layouts on top  of the OpenGL Surface View. It can be done in the Activity and it’s very easy: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mRenderer = new UIExampleRenderer(this); mRenderer.setSurfaceView(mSurfaceView); super.setRenderer(mRenderer); LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); TextView label = new TextView(this); label.setText(“Halo Dunia!”); label.setTextSize(20); ll.addView(label); label [...]


Feb 15, 2012

Rajawali Tutorial 5: Skybox

Posted by Dennis in 3D, Android, Rajawali 2 comments

I’ve just pushed some new files to Github. It’s now possible to add a skybox to the scene. Make sure you put six images in /res/drawable-nodpi/ and pass them to the setSkybox() method: setSkybox(R.drawable.posz, R.drawable.posx, R.drawable.negz, R.drawable.negx, R.drawable.posy, R.drawable.negy); The images are courtesy of Emil Persson aka Humus. Check his website for an awesome collection [...]