
P.S: I usually calculate the normals myself from the vetices/indices, but if you're able to obtain them in some other way it might work as well. However, as warmi said, this kind of drawing shapes is usually done just for debugging: in real applications you want to display real meshes instead of the "default shapes": that's why some people could think of just relying on the debug drawer (that can do some "raw" wireframe rendering (inaccurate for some shapes like multisphere)) or raycast screenshots, without writing any code for displaying shapes.Īdditionally, even if you target openGLES, for problems related to the mesh topology you can still take a look at the code in libOpenGLSupport (the basic brick of all the Bullet demos). First of all, declare OpenGL ES use in your AndroidManifest.xml: And then. Here I’m going to show you how to draw a pentagon with OpenGL ES 2.0. So rasterization is actually a process of generating fragments. Im hoping they added something in ES 2.0 for it. Rasterization is a process to map point, line or triangle into pixels on the screen, every mapping area is called a fragment. Again, I know I remember seeing it for OpenGL because I was really bummed that it wasnt in ES 1.0.

OpenGL ES Shading Language (GLSL ES) 3D scene drawing: representing user. You can also use btShapeHull and btConvexHullComputer (inside LinearMath) to perform the same task (btConvexHullComputer gives better results).įor other shapes (sphere, capsule, cylinder, multisphere, cone) you can't use this method and you should draw them manually using the shape parameters (radius, height, etc.). I need this to work for any defined face with coplanar tris. apples, trees, buildings, and the human hand and face More than 500 line.

For polyhedral convex shapes (such as box, convex hull shapes and a few others), you can make Bullet calculate the indices for you (see btPolyhedralConvexShape::initializePolyhedralFeatures() and the classes btPolyhedralConvexShape.h and btConvexPolyhedron.h).
