[PLUG] Simple graphics programming?

Kyle Hayes kyle at silverbeach.net
Mon Apr 5 16:19:02 UTC 2004


On Monday 05 April 2004 15:24, Elliott Mitchell wrote:
> So interpreted 2D. Tcl/Tk sounds like the closest match here,
> however I do feel Tcl/Tk is a dead end, I imagine it will be a few
> years before it is a dead language but the future doesn't look
> good.

Hmm, not really.  I can't think of any major new project that uses it.

> RPN is a bit weird for people who are used to scripting, but Jeme's
> mention of PostScript does have merit. Unlike Tcl/Tk, PS isn't
> going to die anytime soon. PostScript is also oriented solely at
> drawing things, not at producing a GUI with areas for drawing being
> one widget.

Unfortunately, knowlege of postscript isn't really going to help you 
understand much of the commonly used graphics systems.  The raw 
concepts are the same (lines, points etc.), but between the RPN 
syntax and the rest, I just don't think this would be the best place 
to start.

> I haven't touched Python or Perl enough to recommend drawing
> libraries, though I've seen an awful lot of mentions of "wxPython".

There are other graphics libraries.  wxWidgets (used to be wxWindows) 
is a full windowing library.  Is that what is really needed?  See 
below.

> > When I was a kid, I had AppleBasic (and later, GW-Basic).   What
> > would you point a smart 12-year-old kid at to get 'im started
> > down the garden path these days?
>
> The above are some options. The question is trying to avoid going
> too deep.
>
> Might also try one of the game engines. All of the recent FPSes are
> deliberately designed with scripting interfaces nowadays. I don't
> know how advanced they are, but might be right for handling a 3D
> engine. Both of the big FPSes (Unreal Tournament and Quake
> families) are available for Linux.

This is a good point.  I am not a gamer nor do I know any, but I did 
work in the VR industry for a while a long time ago.  Even then, 
there were libraries that allowed you to script 3D.  This might be a 
bit much though.  It is a lot harder to do interesting and 
nice-looking things in 3D than most people think.  The potential for 
frustration is very high.

> On a more general front Java is still very much alive and usable
> for some graphics. The GTK library is also *very* nice.

I think all of these are pretty difficult to start with.  They require 
a fair number of concepts to be understood before anything can 
happen.  Still, PyQt or PyGTK might be good.  There are some good 
tutorials online.  There are bindings for both Qt and GTK for Ruby 
and Perl too.  I vastly prefer Qt over GTK, but that's due to my 
distaste for faking OO in C.  Sure, you can do it, but I've done it 
in assembly too.  It still doesn't work as nicely as a real OO 
system.

If you just want graphics, the GD library works well.  It isn't 
interactive, but you can make some nice images with it.  There are 
wrappers for Python and Perl.  I've used the Perl module to do 
prototypes for code I later rewrote in C.  The module was on CPAN.  
The Python wrapper is also OO and is here:

http://freshmeat.net/projects/pythongd/

Plus, GD comes with most distros.  The main GD site is here:

http://www.boutell.com/gd/

One of the nice things about GD is that is is actually very simple C 
code.  It isn't spectacularly fast, but if you ever want to dig into 
it and see how it all works, it is quite easy to understand.  Except 
maybe for the PNG and JPEG encoders :-)

While I'm not a Python person, it does seem like a really easy 
language to learn and it supposedly very good for people starting 
out.  Perl is probably _not_ the best first language to learn.  All 
the sigils....  And, I normally program in Perl :-)  I just don't 
know enough about Ruby to say either way.  The interactive command 
line tools for Python and Ruby are really handy when you are learning 
the languages.

You might want to look at what language seems best suited and then 
figure out what libraries are supported.

Best,
Kyle





More information about the PLUG mailing list