Draw polygons in 3D world?

Hi guys!

Do you have any solutions for drawing polygons in the 3D world? Would that be OpenGL or editing meshes?

Thanks in advance!
Max

Maybe geometry shaders? I don’t have any idea. It is also dependent of that if you need collision or not!

Hi! I don’t need collisions. It’s purely graphical, like render.drawLine

Than geometry shader which I don’t know how to use could help!

You won’t need geometry shaders just to draw some polygons on the screen. Depending on how flexible you need the polygons to be, you have a number of options.

  1. This one is the easiest. If all the polygons you are drawing on the same shape then you can just model that shape in Blender. Then in the game you spawn one object for each of the polygons and you can control the location, orientation, and scaling individually.

  2. This one is a bit more involved. If the number of sides are constant, you can model the polygon and put a bone at each vertex and fully weight paint the vert to the bone. At run time, you spawn you polygon then move the bones around to dynamically alter the shape of each polygon.

  3. This one is hard if you don’t have any OpenGL programming experience. You can use the “BGL” (Blender OpenGL Wrapper) to do anything that OpenGL can do. The wrapper seems to be limited to OpenGL 1.x, but it is pretty easy to do:


glBegin(GL_QUAD)
glVertex(...)
...
glVertex(...)
glEnd()

which is the most basic thing you can do with OpenGL.