views:

101

answers:

2

I'm interested in developing an android application that will display a globe of some sort like Google Earth.

I've never used opengl or have any experience with graphic programming so I'm here to learn some basics. Now, I know there are things like the Unity or Ogre that help facilitate graphics but what exactly do I gain from using these engines as opposed to just using opengl api to render graphics? Why do you use engines like Ogre as opposed to straight up opengl?

+1  A: 

There's a lot more to creating a graphics application than just a 3D library.

Libraries like OpenGL map the hardware-specific functionality of your graphics hardware (as well as emulate unsupported functionality in software), but that's just the beginning.

First of all, you need to manage your objects. You need to find a way to convert them from your 3D software (Maya, Max, Blender) to whatever data format you want to store them in your application in, and you need to store them in your application somehow using control structures.

You need to transform them, animate them, skin them. You need a scene management to easily cull out objects outside the frustum. You need a camera and move it.

You need to handle lighting, light sources. You need to handle render passes, like a light pass, shadow pass, reflection pass.

Then you need some good shaders, some that support features like diffuse maps, normal maps, specular maps, ambient occlusion maps, light maps, that support point lights, directional lights, spot lights.

You need to manage textures, stream them in and out and apply them to your models.

So... those are some of the things a 3D engine package does for you. And a lot more.

EDIT: That said, if all you want is display a globe, using a full-blown engine is overkill. For that, you want something like OpenGL, create a model of the globe (=a simple sphere), apply a texture to it, set a light or two, and render it.

EboMike
Do you have any suggestions for good books or learning materials that cover 3D engines? I'm specifically interested in the aspects you described above but not so much about games in general as I've found most 3D engine materials covers a gaming aspect. I'd like to render a globe, have users easily navigate the globe, zoom in and out, and place various tags on the surface that can indicate different sorts of information like a landmark.
RandNine
Funny how "skinning" an object in a 3D engine is the *opposite* of what is meant in the real world. :)
Arafangion
@Rand: It still sounds like OpenGL is the way to go for you - especially on Android, where you want to keep a small profile and don't burden your app with an engine of which you'll only use 5%. As for books - "there are so many out there", but I don't know which ones to recommend. Personally, I'd suggest starting with simple OpenGL demonstrations. The good news is that you can use a generic OpenGL example for PC (since there are so many of them), and then look at Android-specific stuff once you're comfortable with OpenGL.
EboMike
To elaborate some more - the main thing you need to do is understand the basics of 3D rendering (viewports, matrices, models). See how do you things in OpenGL (set up a viewport, render a triangle, transform it). There are great examples for Android too (there's even an app to just demonstrate the basics!).
EboMike
A: 

A 3D engine will help you with a number of things :

  • They usually come with predefined data formats, so you don't have to create yours. Sometimes they also come with tools with nice interfaces that help you create 3D objects. Or, they can load or convert popular file formats so you can use popular tools to create your 3D.
  • They come with rendering loops and maybe event loops so you don't have to implement those. It's often easier than doing it yourself.
  • They come with already written algorithms to do hidden surface removal.
  • They come with high-level functions to easily do complicated stuff with the objects they provide you.
Jean