Xah Lee, 2007-12-29
[this essay is a rambling about programing GUI app and 3D geometry]
I have a problem. I want to do 3D geometry visualization programing, but there is no appropriate tools. (see Requirements For A Visualization Software System For 2010) O, fuck the industry.
I never had any experience writing a GUI application. (except web/HTML form based ones, which doesn't really count.) About 3 times in different years since 1997, i tried to learn GUI programing thru Java's Swing (Java)↗. But each time i aborted rather even before getting a basic understanding of how to create a menu. Today is another try, and perhaps the furthest i've made. To make a empty window with a menu with no actions attached, requires some fucking 170 lines of java code, and tens of classes and objects with complex relationships. (sample code here:MenuLookDemo.java)
So, i am wondering, is this the general state of affairs for GUI programing, or is it just Java? I asked a bit on freenode irc, and it seems to be java, although i guess programing GUI using any widget toolkits is not gonna be a walk in the park.
I like to work on software projects that are mission critical or serious, so i don't regard GUI apps that much important. Nevertheless, GUI, as its name implies, provides a graphical user interface, and is in fact a element most software needs. In particular, one of my hobby is programing geometric visualization or some geometry related recreational math. (imagine interactively viewing a molecule structure in 3D) But, i can't create such recreational programs without using a GUI. (unless i'm doing it inside Mathematica, but that requires Mathematica)
So, even knowing it's gonna be a pain, and at this point i'm gonna abandon Java's Swing again because it is intolerable, but i did half-heartedly looked into alternatives of GUI widgets, in part to acquaint myself what's out there, and maybe pave the road to learn a thing or two about how to actually use a widget toolkit to create a menu or button.
It seems to me, the most popular GUI widget out there are: GTK↗, Qt (toolkit)↗, Tk (framework)↗.
Each has various language bindings. I think i might want to start to tinkle with PyGTK↗.
One thing interesting is that Cairo (graphics)↗ is a recently developed library for drawing vector graphics, and recent version of GTK+ uses it. Another interesting tidbits i learned is that GoogleEarth↗ and Opera (Internet suite)↗ and Skype↗ uses Qt.
Ok, that's about the GUI bit. But what about geometry visualization programing bit? The answer, is pretty much OpenGL↗ (Mesa 3D↗), Direct3D↗.
Direct3D is Windows only. Since my professional expertise all lies in unix, and basically don't know much about Windows's technologies, so Direct3D is out for me.
Now, i have read about OpenGL a lot since 1994... but basically it is more low-level pain, perhaps a order of magnitude more painful than doing Java Swing. However, if you really want to get down to creating a geometry visualization software that is good quality (namely, fast), OpenGL or similar is a inevitability. (the alternative, of doing projections yourself and paint them to screen, is hackish and way slower)
Given my problem and persistent infatuation with visualization of geometry, i think going down getting familiar with OpenGL stuff is necessary, or strongly advisable. So, i started to read many articles on Wikipedia related to computer graphics, in particular the low level stuff. Here's some random articles or terms i'm learning or read.
Graphics pipeline↗. This is the most important concept. Basically, a 3D scene is passed to the graphics card, and processed in various stages, to produce a 2D bitmap for the screen.
Here are some general important concepts.
Some concepts at the bitmap stage.
... it seems to me that there are no high-level graphics engines. Fahrenheit graphics API↗ and QuickDraw3D↗ are supposed to be the one but went no where.
Some of the free game engines:
Some free physics engines:
Here's some articles related to game development.
Fog of war↗ My god, i've playing Gor in Second Life and this term describes it well!
I don't have experience about the higher levels described in the article, but in Second Life Gor, basically we are tribes and constantly engage in battle. (using swords and arrows) After a while a battle is engaged, things often become one bag of confusion. You don't know where your teammates are, or how many still alive, you don't know how many or where enemies are, and you receive contradictory information or commands, including from your leaders (often missing), and sometimes you don't know which group is foe. In such a situation, either you run (flight), which pretty much ensures the likelihood of your team all get captured, or you keep shooting, which often result in your dying shortly. (because you are aimless and have little support)
For comments, please go to: http://xah-lee.blogspot.com/2007/12/graphics-programing-pains.html.
Related essays:
Page created: 2007-12. © 2007 by Xah Lee.