Rajawali

Feb 22, 2012

Rajawali Tutorial 9: 2D Renderer

Posted by Dennis in 3D, Android, Rajawali No 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 No comments

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 all our objects every time the application returns to this method. The onSurfaceCreated() method is typically called when the application is launched for the first [...]


Feb 22, 2012

Rajawali Tutorial 7: Creating a Custom Material / GLSL Shader

Posted by Dennis in 3D, Android, Rajawali 2 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 7 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 [...]


Jan 16, 2012

Rajawali Tutorial 4: Optimisation

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

The onSurfaceCreated() method in the Renderer is called every time the rendering starts or whenever the context is lost. This typically happens when the orientation changes or when the device wakes up after going to sleep. When the context is lost, all the textures are deleted from memory. This is not something Rajawali inflicts upon [...]


Dec 5, 2011

Rajawali Tutorial 3: Materials

Posted by Dennis in 3D, Rajawali 2 comments

This small tutorial is going to focus on the syntax for creating materials only. If you want to go over the basics then please read this first: Rajawali Tutorial 1: Basic Setup & a Sphere Rajawali Tutorial 2: Creating a live wallpaper and importing a model Alright. Let’s create some materials Simple Material A basic [...]


Aug 25, 2011

Rajawali Tutorial 2: Creating a live wallpaper and importing a model

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

I’m going to be lazy and make you download the zipped Eclipse project. Get it here. The basics of Android live wallpapers are well documented so I won’t go over that. I suggest you take a look at AndroidManifest.xml, /res/xml/preferencescreen.xml, /res/xml/settings.xml and com.rajawali.tutorials.WallpaperSettings for wallpaper specific stuff. Here are the specifics for Rajawali. The RajawaliTutorial2Wallpaper [...]


Aug 24, 2011

Rajawali Tutorial 1: Basic Setup & a Sphere

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

So here’s the first very basic Rajawali tutorial. Any questions, let me know Create a new project in Eclipse (Right-click in Package Explorer and choose New > Project … Android Project). Use these values in the configuration screen: project name: RajawaliTutorial1 the “Build Target” should be at least “2.2″ application name: RajawaliTutorial1 package name: rajawali.tutorials create [...]


Aug 23, 2011

Announcing Rajawali: An OpenGL ES 2.0 Based 3D Framework For Android

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

I’ve been working on this on and off for the last couple of months. It is by no means a fully-featured 3D engine. It has some nice features and I figured I might as well move it to a public repository so other people can use it as well. The other 3D engine for Android [...]