[Oz] Animation programming in Oz

Denys Duchier Denys.Duchier at ps.uni-sb.de
Mon Jun 19 15:47:04 CEST 2000


mikki at ida.liu.se (Mikael Kindborg) writes:

> What I want to do is to render sprites into an off-screen image and
> then blit that image to the display (to reduce flicker). I can not
> see how to use the Image object or Canvas for this.

The "Window Programming Tutorial" has an example that is a bit like
this.  You can find it in section "6.4 Example: An Animated Time
Waster".  It uses a bitmap in a canvas.

> In addition, I would like to use sound (wave and midi).
> Are there support for this from Oz?

As far as I know, we don't yet have any sound card interfaces.  It
would be great if someone contributed one (hint :-).  The only thing
that should be trivial to do from Oz, is to open /dev/audio and write
directly to it.  If you need to talk to a driver, then you will have
to write a native functor to do the job: this is how Oz can be
extended to call arbitrary system libraries.  Writing native functors
is quite easy and reasonably well documented in the "Application
Programming Tutorial".

> The background is as follows. I am working on a project
> (my PhD-project) where I study programming tools for
> social agents. The user category is 10-12 year old children.
> I experiment with the visual language of comics as a
> representation for concurrent programs that use guarded
> clauses. My work is similar in spirit to the work on
> ToonTalk by Ken Kahn (http://www.toontalk.com).

That sounds fascinating.  I attended a talk on toontalk with demos,
and it was loads of fun :-)

> However, I feel that Oz would be interesting to experiment
> with as an implementation language, for many reasons.

Yes, Oz would be a very good implementation language for such a
project... and, Oz additionally gives you transparent support for
distributed computing, which might come in very handy for multi-user
worlds and collaborative environments.

> The interpreter I have written in Java is very simple, and I would
> like to have more advanced language elements, like logic
> variables. Implementing this is not trivial, and I thought that I
> might compile the visual comic strip expressions to Oz, or to write
> an interpreter in Oz. Any suggestions or comments on this?

Well, we don't really know what you are talking about (visual comic
strip expressions?) so that it is a little difficult to make concrete
or helpful suggestions :-)  I checked out your home page, but could
not find any info that would help decypher your question.

> Any hints on animation in Oz, sound in Oz, and examples of
> interpreters written in Oz, would be highly appreciated!

An interpreter in Oz is written pretty much like you would write it in
another high-level symbolic language.  One simple easily extensible
design is (1) to represent statements as terms and (2) implement the
interpreter as an object where you simply invoke the statement as a
method.

Note that you might also consider compilation into Oz.  The Oz
compiler is a 1st class object and can be used from within a program
to compile e.g. Oz code that you generate yourself.

Cheers,

-- 
Dr. Denys Duchier			Denys.Duchier at ps.uni-sb.de
Forschungsbereich Programmiersysteme	(Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45	http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50			Phone: +49 681 302 5618
66041 Saarbruecken, Germany		Fax:   +49 681 302 5615
-
Please send submissions to users at mozart-oz.org
and administriva mail to users-request at mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.





More information about the mozart-users mailing list