Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Wednesday, January 5, 2011

More 3D android stuff - animated models

Ok I have barely been home in the past couple of weeks so couldn't work on this little android 3D engine side project much, but here's an example of my animation class so far:

http://www.youtube.com/watch?v=MTh6nbvCcZg

Uses Hierarchy type animation, as opposed to the skeletal animation in the PC 3D stuff I've been doing. Imagine each section of the model being devoted to one and only one bone instead of 4 bone weights per vertex, I figure this is the lowest cost on the hardware since I'm not sure how much I can push the android. The next step I guess would be to either use softskinning via direct vertex pos interpolation between keyframes, or bones with 1 or 2 weights per vertex.

This is all done with OpenGL in Java.

Each little section of the model can also have a unique material property which I guess I'll have to showcase next, but I need to get my hands on a real android so I can take video that isn't so choppy. Emulation sucks.

Friday, December 17, 2010

Here I come, Android - Trying out 3D on the android

Remember my "Foof Engine" for the PC? My ongoing 3D engine project which was seemingly surrounded in ridiculous characters? :) It was truly a prototype for bigger and better things, and I'm still not ready to showcase what's been going on with that.

BUT! Today I figured I should try my hand on 3D on the Android! I've been working on some Android apps lately (again, will showcase those when I'm ready) and figured it's time to tackle 3D. First vid here:

http://www.youtube.com/watch?v=LuMMCLcDVIA

 Not bad for a day's work I'd say. This was all from scratch and most of the work was spent on writing the mesh class and the math. I got a little spoiled by the D3DX and XNA math libraries. It's been a while since I touched OpenGL but it hasn't changed a bit, anyone familiar with it at all should feel at home with the implementation on the Android.

I rolled a custom model format based on the one I use in the Foof Engine tech demos, but watered down tremendously - no bone weights, no support for normal maps, etc. I think I'll use a simple hierarchy based animation system in favor of more processor intense ones like vertex tweening or bones.

I put all my models and textures into the /res/assets/ folder, this is where you should put all your raw data that you don't want the IDE to give built in ID codes to, so you can access them by name. 

Textures in the sample were borrowed from CGTextures.com, and the unicorns are actually a snapshot of ones I made in LittleBigPlanet 2. The mushrooms I drew, aren't they pretty?

Mushroom Mushroom

 But all that aside, the render function right now just consists of clearing the screen and then going through a list of meshes and rendering them. I'm going to create a system of hashes to catalog the textures and meshes like I do in Foof Engine. 

I think I can make something cool out of this, so stay tuned. I have some ideas and this, as usual, is just a prototype for bigger and better things.