Latest Entries »

2013 in review

The WordPress.com stats helper monkeys prepared a 2013 annual report for this blog.

Here’s an excerpt:

A New York City subway train holds 1,200 people. This blog was viewed about 3,900 times in 2013. If it were a NYC subway train, it would take about 3 trips to carry that many people.

Click here to see the complete report.

Yoda’s Cafe Storyboard Updated

Storyboard updated with color

Storyboard

Storyboard

Yoda’s Cafe Android App Demo

Demo Video of our app now on YouTube!

Team Yoda Final Report and Zipped Application

https://www.dropbox.com/sh/2q56587r0ipg941/G9FWCoSqJx

https://www.dropbox.com/s/22urwceqxnde1ec/TeamYodaApp.zip

Team Yoda’s Marketing Video

https://www.dropbox.com/s/wlotth2az7kw5ij/marketing_vid3.mp4

https://www.dropbox.com/s/c6sfdw85jq4wewb/TeamYodaApp.mp4

Adding a Pre-Loader to App

How to add an application pre-loader/startup/splash screen in Androidhttp://stackoverflow.com/questions/5865697/how-add-an-application-pre-loader-startup-screen-splash-screen-to-my-phonegap-an
Async Task Packagehttp://developer.android.com/reference/android/os/AsyncTask.html

Drawing Text in OpenGL for Android

Online post on a few ways to add text in OpenGL check it out!

The Android SDK doesn’t come with any easy way to draw text on OpenGL views. Leaving you with the following options.

Place a TextView over your SurfaceView. This is slow and bad, but the most direct approach.
Render common strings to textures, and simply draw those textures. This is by far the simplest and fastest, but the least flexible.
Roll-your-own text rendering code based on a sprite. Probably second best choice if 2 isn’t an option. A good way to get your feet wet but note that while it seems simple (and basic features are), it get’s harder and more challenging as you add more features (texture-alignment, dealing with line-breaks, variable-width fonts etc.) – if you take this route, make it as simple as you can get away with!
Use an off-the-shelf/open-source library. There are a few around if you hunt on Google, the tricky bit is getting them integrated and running. But at least, once you do that, you’ll have all the flexibility and maturity they provide.

(answer from Dave 2009)

Rendering text to a texture is simpler than what the Sprite Text demo make it looks like, the basic idea is to use the Canvas class to render to a Bitmap and then pass the Bitmap to an OpenGL texture:

android code snippet:
// Create an empty, mutable bitmap
Bitmap bitmap = Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_4444);
// get a canvas to paint over the bitmap
Canvas canvas = new Canvas(bitmap);
bitmap.eraseColor(0);

// get a background image from resources
// note the image format must match the bitmap format
Drawable background = context.getResources().getDrawable(R.drawable.background);
background.setBounds(0, 0, 256, 256);
background.draw(canvas); // draw the background to our bitmap

// Draw the text
Paint textPaint = new Paint();
textPaint.setTextSize(32);
textPaint.setAntiAlias(true);
textPaint.setARGB(0xff, 0x00, 0x00, 0x00);
// draw the text centered
canvas.drawText(“Hello World”, 16,112, textPaint);

//Generate one texture pointer…
gl.glGenTextures(1, textures, 0);
//…and bind it to our array
gl.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);

//Create Nearest Filtered Texture
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_LINEAR);

//Different possible texture parameters, e.g. GL10.GL_CLAMP_TO_EDGE
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_REPEAT);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_REPEAT);

//Use the Android GLUtils to specify a two-dimensional texture image from our bitmap
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);

//Clean up
bitmap.recycle();

Answer from JVitela 2011
http://stackoverflow.com/questions/1339136/draw-text-in-opengl-es-android
OpenGL live text-rendering http://stackoverflow.com/questions/2071621/opengl-live-text-rendering
Font Stash: How to do font stuff http://digestingduck.blogspot.com/2009/08/font-stash.html
Drawing Text in OpenGL ES http://www.koushikdutta.com/2008/10/drawing-text-in-opengl-es.html

Animating Image Sequences in Android

For the Character Animation, we might have to resort to have rendered image sequences and place those into the app instead, because there are currently not efficient or working plugins to convert Maya/3ds Max animations as MD2 (holds binary information & animation), or the ability to create an OBJ Sequences.

Image Switcher Class: http://developer.android.com/reference/android/widget/ImageSwitcher.html

Package: Android.Animationhttp://developer.android.com/reference/android/animation/package-summary.html
Animation Resource: http://developer.android.com/guide/topics/resources/animation-resource.html

Have constant looping animation: http://stackoverflow.com/questions/3335108/image-animation-in-android

Canvas and Drawables http://developer.android.com/guide/topics/graphics/2d-graphics.html

Animated Images in Android (has a short simple tutorial on how to do it) http://tekeye.biz/2012/animated-images-in-android

AnimationDrawable Class (this might be exactly what we need): http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html

Android Animation Framework Tutorial (This tutorial mainly focuses on tweening animations – which we dont need – it found be frame by frame animation) http://developerlife.com/tutorials/?p=343

Project Assignment 3

https://www.dropbox.com/s/qcbcn57jclanli7/TeamYoda_PA3.zip