Pyramid, Cube in LWJGL

Hello,
I’m new in OpenGL(LWJGL). Now I’m understand how to draw 2D Triangles/Squares(too Points :o), set color to Triangles/Squares, Rotate Triangles/Squares.

But I’m stuck with how to draw real 3D objects(something like Pyramid, Cube). I’m know for pyramid I’m need Front,Back,Left, Right and for Cube need Front, Back, Left, Right, Top, Bottom vertices. I am copy this vertices from NeHe tutorial(http://nehe.gamedev.net/tutorial/3d_shapes/10035/) and all work. But I’m don’t understand how to set this vertices from mind. I’m only know how to set vertices for Front and Back, but how to left, right, etc. How all works?

Sorry for stupid question, but I’m don’t understand. Maybe is good tutorial for this situation?

Thanks and sorry for my bad English language.

:slight_smile:

What do you mean, “from mind”?

Try a paper with a grid, paint the surfaces and count grids to get the vertex positions?

You pretty much have to put all the vertexes for a 3D object together yourself. Eventually you will get used to drawing the basic shapes such as cubes and triangles

Another way you can do this is set up some kind of static render function in a class the takes positional and size parameters and then easily draws one of those shapes to the screen. This means you don’t have to repeat the algorithm every time you want to do it. So say for example if you wanted to draw a blocky man, like minecraft steve, you would just be able to add a bunch of cubes to his model data rather than having to enter in each of his vertexes