views:

638

answers:

2

Hello, I'm new to opengl-es and I wonder how people are able to draw these much detailed OpenGL ES graphics, e.g. on Android OS. It's already hard to draw a single squre, because it's composed of triangles due to the reason that OpenGL ES obviously cannot draw anything else than triangles. I thought about this approach:

  • Drawing and rendering an object in Blender.
  • Export it somehow as array of vertices and an array of colors
  • Copy this array of vertices into the Java code
  • Run the code

Or are there approaches to solve such problems in a better way? I do not think that people just "draw" their graphics as array of vertices in the code. I'm sure they draw them anywhere else and import it into the code. If there is such a solution with Blender, I would be pleased to know how this is solved.

Regards.

+2  A: 

You can save your model from Blender e.g. as Wavefront OBJ file. In Blender, you can also select to triangulate the model for you, which will result in a list of just triangles, ready for drawing. OBJ is a very simple format, it just lists in ASCII the position of each vertex and then which vertices belong to each triangle. Either convert the OBJ to a format specific to your application (e.g. binary buffer you can directly load to OpenGL) or find yourself one of the many OBJ loaders, or write your own reader.

There are a lot of other common formats available, you should take a look at them and see if there is an importer for Android available.

zerm
+2  A: 

What I've found is that you can Load 3D models with min3D directly to your program using:

min3d

I hope this helps.

Lord Otori
This looks very good. Thanks.
Bevor
I really hope this helps, I was just trying to do something similar I guess....
Lord Otori