# Applying transformations in Geometry Shader

So, I am trying to program in opengl (3.3) a kind of robot. The idea is that I have some simple blocks that represent his body (4 rectangles for his arms, one for the torso and the last one representing the head). To simplify a made a bad picture of my idea.

So now what I want to do is to make him move his arms depending on keyboard commands. Doing that would be just rotating each arm the amount that you want (translating too). But I am stuck because the only way I found to make striped rectangles (just the borders) is using the geometry shader. From the little I know about opengl, transformations are applied in the vertex shader, which would not work for my idea. Would be inefficient to apply the transformations on the geometry shader? (It is from what I know). If so, is there an easier way of drawing those rectangles?

EDIT: Ok, I can simplify a lot this question. The thing is that I want to draw those "skeletal" rectangles, but the only way I know how to do it is using the geometry shader. But with this comes the problem of the transformations, so I would want to avoid doing that. There is another way to draw those skeletal shapes?

• Hello and welcome, but first of all - please match question title with its contents, from your title is not clear what exactly are you asking. And second - what are you actually asking? There is more then one question in there. Do you need to know about skeletal animation or drawing wireframe or details about geometry shader? – wondra Sep 11 '14 at 22:53
• oops, I will change the title – lhahn Sep 11 '14 at 23:39
• Ok, I was probably not clear. The thing is that I want to draw skeletal rectangles (just borders) but the only way that I know is using the geometry shader. There is another way to do it? – lhahn Sep 11 '14 at 23:41
• ...and what do you mean with "just borders"? Wireframe model or silhouette or something else? – wondra Sep 11 '14 at 23:45
• I already found, there is GL_LINE_STRIP on the glDrawArrays command, so no problem – lhahn Sep 12 '14 at 1:36

I suggest you to have a look at this tutorial that shows how to draw triangles in modern OpenGL. Once you understand how you can draw, play with the function void CGLRenderer::SetData(), which is where you set the actual vertex positions of your primitives. What you probably want to do is modify the Vertex Buffer Object content depending on the key that you press, this will change the position/orientation/size of your shapes.