Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for help/links/notes/agorithms/URLs/examples on drawing/rendering spheres in pure Java (so that I can hopefully, one day, generate/render planets with various surfaces & atmospheres)

So for the moment, i'd be pretty happy to be able to start off with just drawing a wireframed sphere(s).

ps: I don't want to use external libraries like Java3D, JOGL or aftermarket engines like JMonkeyEngine, Would rather keep it as straight Java.

share|improve this question

This is not possible in java as i know.

If you still want to do this in plain java, you will have to implement some kind of simple 3D library by yourself. That is very useful for learning graphics programming, but not easy way how to get things working (and it will be slow, because you will not be able to use gpu). If there is not some special reason to not using libraries i think that you will be good with JOGL.

share|improve this answer
It's actually not that hard to get something simple up and running in 3D. Here's an example link. I didn't want to follow this example because I don't like the idea of merely creating a fixed array, of lets say 100 points, to make a rough looking sphere that was the same size as every other 'planet' of mine, so I was just curious as to whether there were other alternatives/ways/techniques. – d33j Feb 18 '11 at 7:55
@d33j But this just uses some canvas for drawing lines and that's exactly what i meaned by the "implement 3D library by yourself". For something more sophisticated than cube with some crazy hacks to 3D algebra (sorry I dont want to be rude, but that is really not nice). You will have to use 3D api or implement real simple 3D library with view/proj/matrices support for triangles and at least texturing and shading (phong will be for planet enough). – Notabene Feb 19 '11 at 21:32
@d33j But i would like to encourage you. Doesn't matter if you will decide to really implement 3D lib by yourself or use 3D api like Jogl. It will be great fun and great experince ;-] – Notabene Feb 19 '11 at 21:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.