Forum OpenACS Q&A: Database-backed animation

Collapse
Posted by Matthew Soldo on
Sorry for the somewhat off-topic post.

I need to create an application (not neccesarily web-based) that will
draw pictures and animations based on information quaried from a
database. Think drawing the location of objects based upon a live
feed of GPS data. The animation does not have to be at a very fast
rate (1 fps at most, probably more like .25 fps).

I was thinking of using the tk commands built into aolserver, since
all of the database stuff is already built in (and I know how to use
it). I'm also considering Java or visual basic (app will be windows
2000 based).

Thank You.

Collapse
Posted by Michael Feldstein on
Flash 5, I'm told, has very good support for the kind of thing
you're trying to do.
Collapse
Posted by Jonathan Ellis on
tk commands built into aolserver?
Collapse
Posted by Matthew Terenzio on
Flash can accept dynamic text content into an animation, but if you want to create graphics on the fly, you kinda need Macromedia generator, which costs alot.
A free alternative would be to use PHP dynamic graphic creation to generate a graphic, and import that graphic into the playing Flash movie on the fly.
Collapse
Posted by Roberto Mello on
Michael Cleverly, a clever (pun intended) Tcl expert has written a Tk application that will take a series of pictures and display them in animation form, with varying speeds.

He has also written nstcl, which is an AOLserver/OpenACS compatibility layer for plain Tcl, so that you can use the AOLserver/OpenACS (ns_*, db_*, templating, etc.) APIs in plain Tcl. nstcl currently supports Oracle, PostgreSQL and Solid, and AFAIK the next release will also support an embedded database whose name I don't remember.

You could then hack his "animation" app to do the database queries you need using nstcl. This will work for non-web and even web-based uses, although for web use you will need the Tcl plugin installed on the browser.

If you need strictly web-based, then you should probably be better off with Flash or Java.

http://michael.cleverly.com/aolserver/ for nstcl. I don't think he has made his "animation" app available, I saw it at his house in a recent visit (he lives 1.5 hours away from me), but if you ping him I'm pretty sure he wouldn't have a problem releasing it under some free software license.

Collapse
Posted by Roberto Mello on
I should mention that Tk apps will work on Windows, UNIX/Linux and Macs.

If you want to do graphs (pie, bar, line, etc.) then you could easily add support for TGDChart, a gdchart module for Tcl to Michael's app.

I've been using TGDChart successfully in AOLserver to generate graphs from information in Oracle. The pie charts seem to have a problem when you use less than 3 data sets. I found the function call where it crashes, but haven't had time to try to fix it.

http://sourceforge.net/projects/tgdchart/

Collapse
Posted by Matthew Burke on
You should also take a look at the nsgd module.
Collapse
Posted by Tom Mizukami on
I don't know what type of accuracy you need, but I have seen a very similar thing done with XML and SVG. Basically, it was for a trucking company, they had a graphical representation of the US and translated GPS coordinates to x-y coordinates and ploted the points using SVG.
Collapse
Posted by Roberto Mello on
I looked at nsgd before heading to TGDChart. nsgd doesn't output graphs to files, only to the connection, which would be hard to do using the OpenACS templating system (which I am).

Another thing is that it only exposed a little bit of gdchart's features. Being able to save to a file was a big one for me. I even looked at adding that feature to nsgd, but once I found TGDChart, it became secondary.

Collapse
Posted by B. Larkin on
FYI JGenerator (sourceForge) is an impressive open source clone of Macromedia Generator if you decide to go dynamic Flash route. I've used it and since Generator is expensive and is to be discontinued this is a more sensible option.
Collapse
Posted by Torben Brosten on
Matthew Soldo,

Along Tom Mizukami's suggestion of using SVG, you may want to consider webCGM ( http://www.cgmopen.org/ ). Its deployment is more limited than SVG at this point. Still, it might have some additional benefits in your application, since the graphics are vector based.

"The CGM Standard CGM is a format defined by the International standard ISO/IEC 8632:1999 for digitally describing vector, raster, and hybrid (raster and vector) graphic pictures very compactly. It has proven to be a very good format for the technical illustrations in electronic documentation, geophysical data visualization, and other demanding 2-dimensional graphics presentation applications" ( http://www.cgmopen.org/technical/cgm_standard.html )

So the burden of porting some industry graphics could be made easier with this approach.

I don't have any experience with it yet, but am planning on an implementation that will likely be using it (or SVG) sometime this summer.

Collapse
Posted by Henry Minsky on
SVG can do pretty fancy things, especially when combined with
Javascript. You should check out the tutorials on
Adobe's web site. I've been generating small animations and interactive
maps
with SVG dynamically from Tcl, and it works quite well.
SVG is supported as a plugin for internet explorer and netscape.
There's supposedly even a Linux plugin (sigh). In practice,
Internet Explorer is probably your only option to view SVG / Javascript presentations.

SVG is much easier to generate than Flash, in my opinion.
It is just straight XML text. You can compress it for
faster transmission as well (.svgz) using Zip compression.