Discussion:
Mathematica/functional programming tools for creating virtual worlds?
(too old to reply)
Benjamin L. Russell
2008-10-22 07:11:21 UTC
Permalink
Does anybody know of any applications using Mathematica or a
functional programming language for creating virtual worlds?

Specifically, recently, I have encountered a number of applications
for virtual worlds with an educational focus, and am interested in
finding something with a basis in functional programming. Here are
some examples of virtual world projects that I have encountered
recently:

Quest Atlantis
Aims to use a virtual world (actually, a collection of virtual worlds)
in a classroom environment to teach children of ages 9-14 to think
about social commitment and real-world action.
http://atlantis.crlt.indiana.edu/

Croquet
Open-source technology, derived from Squeak, to create and deploy
collaborative multi-user online virtual world applications. Of
particular interest is technology that allows users to create portals
to other virtual worlds by programming in virtual windows that are
themselves parts of a virtual world. Alas, Squeak is based on
Smalltalk, which is object-oriented.
http://www.opencroquet.org/index.php/Main_Page

"Alice: Lessons Learned from Building a 3D System For Novices"
A paper by Matthew Conway et. al discussing lessons learned from
developing Alice, "a 3D graphics programming environment designed for
undergraduates with no 3D graphics or programming experience" (quoted
from the Abstract, p. 1):
http://www.alice.org/publications/chialice.pdf
Here is a link to Alice, the 3D teaching tool for introductory
computing, itself. Alas, Alice is based on Python, which is also
object-oriented.
http://www.alice.org/

The problem with the above-mentioned approaches is that none of them
seem to be based on functional programming.

What would be interesting would be a functional counterpart to one of
the above approaches, possibly based on Mathematica, Haskell, Scheme,
or a similar functional programming language.

Does anybody know of any functional counterparts to any of the above
projects? I think that it would be fascinating to fire up a virtual
world, enter it, and then type something similar to

(create-portal "Alice")

to create a portal to a new virtual worlds called "Alice" (no relation
to the above-mentioned Alice programming environment)

then enter Alice and type, say,

(create-building 'Georgian)

to create a house of Georgian architecture, enter it, then type, say,

(create-room building 'rectangular 25 30)

to create a rectangular room 25 ft. wide by 30 ft. long.

Then I could define a higher-order function, say,

(define (create-building architecture rooms width length height)
(cond ((null? architecture) (display "Bad architecture."))
((= width 0) (display "Bad width."))
((= length 0) (display "Bad length."))
((= height 0) (display "Bad height."))
(else (begin
(create-interior building rooms 'rectangular
width length)
(create-roof building height)
(create-exterior building architecture)))))

and then define a lower-order function for it, say,

(define (create-interior building rooms shape width length)
(if (= rooms 0)
building
(begin
(create-room building shape width length)
(create-interior building (- rooms 1) shape width length)
)))

and so forth.

Aside from higher-order functions, such topics as, for example,
recursion, tail recursion, continuations, currying, and IO monads
could be taught.

-- Benjamin L. Russell
Aaron Gray
2008-10-22 23:10:31 UTC
Permalink
Post by Benjamin L. Russell
Does anybody know of any applications using Mathematica or a
functional programming language for creating virtual worlds?
For creating "scenes" AutoCAD has or used to have lisp for automating
construction. Its very expensive though.

Aaron
Jean-Guillaume Pyraksos
2008-10-24 11:06:05 UTC
Permalink
Post by Benjamin L. Russell
Does anybody know of any applications using Mathematica or a
functional programming language for creating virtual worlds?
The "world.ss" animation teachpack of PLT Scheme is nice.
You can create a scene with animated objects, with keyboard and mouse
response, all within a purely functional framework. An automatic clock
is provided. You just need to model the mathematical "world" and say :

(big-bang width height clock-speed initial-world)

and provide functions World -> World, World -> Image...

Cool.

JG
namekuseijin
2008-10-23 15:37:02 UTC
Permalink
Post by Benjamin L. Russell
Does anybody know of any applications using Mathematica or a
functional programming language for creating virtual worlds?
Specifically, recently, I have encountered a number of applications
for virtual worlds with an educational focus, and am interested in
finding something with a basis in functional programming.  Here are
some examples of virtual world projects that I have encountered
Quest Atlantis
Aims to use a virtual world (actually, a collection of virtual worlds)
in a classroom environment to teach children of ages 9-14 to think
about social commitment and real-world action.http://atlantis.crlt.indiana.edu/
Croquet
Open-source technology, derived from Squeak, to create and deploy
collaborative multi-user online virtual world applications.  Of
particular interest is technology that allows users to create portals
to other virtual worlds by programming in virtual windows that are
themselves parts of a virtual world.  Alas, Squeak is based on
Smalltalk, which is object-oriented.http://www.opencroquet.org/index.php/Main_Page
"Alice: Lessons Learned from Building a 3D System For Novices"
A paper by Matthew Conway et. al discussing lessons learned from
developing Alice, "a 3D graphics programming environment designed for
undergraduates with no 3D graphics or programming experience" (quoted
from the Abstract, p. 1):http://www.alice.org/publications/chialice.pdf
Here is a link to Alice, the 3D teaching tool for introductory
computing, itself.  Alas, Alice is based on Python, which is also
object-oriented.http://www.alice.org/
The problem with the above-mentioned approaches is that none of them
seem to be based on functional programming.
What would be interesting would be a functional counterpart to one of
the above approaches, possibly based on Mathematica, Haskell, Scheme,
or a similar functional programming language.
Does anybody know of any functional counterparts to any of the above
projects?  I think that it would be fascinating to fire up a virtual
world, enter it, and then type something similar to
(create-portal "Alice")
to create a portal to a new virtual worlds called "Alice" (no relation
to the above-mentioned Alice programming environment)
then enter Alice and type, say,
(create-building 'Georgian)
to create a house of Georgian architecture, enter it, then type, say,
(create-room building 'rectangular 25 30)
to create a rectangular room 25 ft. wide by 30 ft. long.
Then I could define a higher-order function, say,
(define (create-building architecture rooms width length height)
  (cond ((null? architecture) (display "Bad architecture."))
           ((= width 0) (display "Bad width."))
           ((= length 0) (display "Bad length."))
           ((= height 0) (display "Bad height."))
           (else (begin
                     (create-interior building rooms 'rectangular
width length)
                     (create-roof building height)
                     (create-exterior building architecture)))))
and then define a lower-order function for it, say,
(define (create-interior building rooms shape width length)
    (if (= rooms 0)
        building
        (begin
          (create-room building shape width length)
          (create-interior building (- rooms 1) shape width length)
        )))
and so forth.
Aside from higher-order functions, such topics as, for example,
recursion, tail recursion, continuations, currying, and IO monads
could be taught.
-- Benjamin L. Russell
Wouldn't you be interested instead in creating exporters for Scene
Description Languages of popular 3D renderers, like Pixar's Renderman
or Povray's SDL? The Renderman SDL is a very declarative and low-
level textual input interface for the software, Povray's is more like
a scripting language, with for loops and simple textual macros. You
could very well design a DSL in some functional language to output
scenes in these well-known formats and then rendering them.
Matt P. Dz.
2008-10-24 17:49:34 UTC
Permalink
Post by Benjamin L. Russell
Does anybody know of any applications using Mathematica or a
functional programming language for creating virtual worlds?
[...]
What would be interesting would be a functional counterpart to one of
the above approaches, possibly based on Mathematica, Haskell, Scheme,
or a similar functional programming language.
Does anybody know of any functional counterparts to any of the above
projects? I think that it would be fascinating to fire up a virtual
world, enter it, and then type something similar to
It might not be exactly what you're looking for, but may nevertheless be
worth a look:

http://www.cin.ufpe.br/~haskell/hopengl/examples.html
http://www.haskell.org/haskellwiki/Opengl#Projects_using_the_OpenGL_bindings
http://www.haskell.org/haskellwiki/Frag

Best,

Matt P. Dz.
Grant Rettke
2008-10-26 03:16:33 UTC
Permalink
Post by Benjamin L. Russell
Does anybody know of any applications using Mathematica or a
functional programming language for creating virtual worlds?
Do you want it to be functional in order to teach functional
programming?

You should check this out:

http://world.cs.brown.edu/

Loading...