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.)
#include "User0.scene"
switch valleyswitch ()
{
light ((1 -1 1),(.7 .7 .2),(.1 .1 .4))
environment ((.1 900),skyTopColor(.2 .3 .4),skyBottomColor(.3 .5 1),
horizonColor(.7 .5 .2),
(lin .5 .5 .5 10 1000),(SKY_CLEAR))
object(("valley.pfb"))
/* clouds */
object(("cloud.pfb"),(50 50 50))
object(("cloud.pfb"),(-40 80 60))
object(("cloud.pfb"),(100 120 40))
object(("cloud.pfb"),(80 50 40))
object(("cloud.pfb"),(-150 200 50))
object(("cloud.pfb"),(150 220 40))
object (("tree/tree.pfb"),(70 80 -8),(40))
object (("tree/tree.pfb"),(-56 141 -5),(30))
}
transform ((0 150 0))
{
switch houseOutside ()
{
object (("house_exterior.pfb"))
object (("house_exterior_doorframe.pfb"))
userTrigger (( -3 -15 0 3 -10 10),
when(enter,dooropener.))
}
timer dooropener ((0),(120),(1),
when(changed,door.(0 0 $value)),
when(,houseInside.,houseOutside.,valleyswitch.
,houseinsideobject.(true)+2,swelltimer.))
object door (("door.pfb"),(-2 -9 0),(0 0 0))
switch houseInside ()
{
object houseinsideobject (("house_interior.pfb"),())
light ( (10 15 10 1),(.4 .4 .4))
light ((.3 -1 1),(.5 .5 .5),(.3 .25 .2))
object (("sofa.pfb"),(15 24 0))
object (("coffeetable.pfb"),(15 20 0))
object cloud1 (("cloud.pfb"),(0 40 20))
object cloud2 (("cloud.pfb"),(10 50 18))
object cloud3 (("cloud.pfb"),(-5 60 20))
object cloud4 (("cloud.pfb"),(15 65 15))
environment (( -20 0 15 20 100 50),(lin 1 1 1 1 30))
timer swelltimer ((5),(1),(1.4),
when(changed,cloud1.($value),cloud2.($value),
cloud3.($value),cloud4.($value)),
when(,),when(,))
}
}
(c) Ben Chang


