Creating Objects

Now i m working on a 3d modelling editor
its ok to load objects from files, giving texture or material to them
and i have no problem with dragging selection and moving objects
i nearly finished what i want to do, i can also add
any kind ogf light source to scene.

But now lastly i want to be able to draw my own lines objects such as cubes, boxes, toroids, etc.

The question is how?
i can use glut for it but how to obtain the vertices when i need to save my scene to a file…

Can someone give me a suggestion, should i wrote my own algorithms by using geometry.

or is there a faster way a high level api whichh i can use to create and obtain vertices of objects?

Sorry for my english…

Well as far as I know, you can’t get the vertices from an object created with glut. I think you will just have to write your own libraries to generate the object you are looking for. There may be some good algorithms you can look at from some of the open source modeling programs. Like maybe this one perhaps: If you want more typing something along the lines of “open source 3d modeler” or whatever in google will come up with some more programs. I’m not familiar with this particular one but it sounds good from the description. Anyway, just take a look at this modeler’s source and see how they do this.