An Example Ygdrasil Scene

Here's an example scene to provide a taste of what Ygdrasil is like. It includes a valley, a house, a couple of trees, an animated door, some animated clouds, and a nifty trick to make the inside of the house larger than the outside actually is.

To try out this scene, first download the demo file. Uncompress it to get a folder called "ygdemo1". Open the terminal and cd into that directory. type './rundemo' to run the demo.

ygdemo1.tar.gz (2.7MB)
ygdemo1_smaller.tar.gz (116.4 Kb. Same scene, but without the nice trees.)

The code probably won't make too much sense yet, but will give you an idea of what the language looks like.
#include "User0.scene" switch valleyswitch () { light (position(1 -1 1),diffuse(.7 .7 .2),ambient(.1 .1 .4)) environment (clip(.1 900),skyTopColor(.2 .3 .4),skyBottomColor(.3 .5 1), horizonColor(.7 .5 .2), fog(lin .5 .5 .5 10 1000),mode(SKY_CLEAR)) object(file("valley.pfb")) /* clouds */ object(file("cloud.pfb"),position(50 50 50)) object(file("cloud.pfb"),position(-40 80 60)) object(file("cloud.pfb"),position(100 120 40)) object(file("cloud.pfb"),position(80 50 40)) object(file("cloud.pfb"),position(-150 200 50)) object(file("cloud.pfb"),position(150 220 40)) object (file("tree/tree.pfb"),position(70 80 -8),size(40)) object (file("tree/tree.pfb"),position(-56 141 -5),size(30)) } transform (position(0 150 0)) { switch houseOutside () { object (file("house_exterior.pfb")) object (file("house_exterior_doorframe.pfb")) userTrigger (volume(box -3 -15 0 3 -10 10), when(enter,dooropener.start)) } timer dooropener (startValue(0),endValue(120),duration(1), when(changed,door.orientation(0 0 $value)), when(end,houseInside.on,houseOutside.off,valleyswitch.off ,houseinsideobject.wall(true)+2,swelltimer.start)) object door (file("door.pfb"),position(-2 -9 0),orientation(0 0 0)) switch houseInside (off) { object houseinsideobject (file("house_interior.pfb"),floor(true)) light (position (10 15 10 1),diffuse(.4 .4 .4)) light (position(.3 -1 1),diffuse(.5 .5 .5),ambient(.3 .25 .2)) object (file("sofa.pfb"),position(15 24 0)) object (file("coffeetable.pfb"),position(15 20 0)) object cloud1 (file("cloud.pfb"),position(0 40 20)) object cloud2 (file("cloud.pfb"),position(10 50 18)) object cloud3 (file("cloud.pfb"),position(-5 60 20)) object cloud4 (file("cloud.pfb"),position(15 65 15)) environment (volume(box -20 0 15 20 100 50),fog(lin 1 1 1 1 30)) timer swelltimer (duration(5),startValue(1),endValue(1.4), when(changed,cloud1.size($value),cloud2.size($value), cloud3.size($value),cloud4.size($value)), when(back,reverse),when(front,forward)) } }

(c) Ben Chang