|
Language specification (draft 0.2)
0. INTRODUCTION
[to be done...]
1. BASICS
Panorama scene language is based in objects. Objects are instances
of a class, the same way a variable is an instance of its type. Each object
has some attributes that differentiates it from every other object. This
attribute will always have the form of a keyword followed by an instance
of the right type:
translate <0, 0, 0> (Type is vector)
radius 10
(Type is real)
Objects can be created in any of these three ways:
-
From scratch:
light light_name
{
translate <0, 1, 0>
color CRed
}
This way, object will be an instance of the default class for the family
(e.g. PointLight in the light family). Some families of classes has no
default, so they cannot be instantiated this way.
-
As an instance of a given class:
light light_name : class WarnLight
{
translate <0, 1, 0>
point_at <0, 0, 0>
color CWhite
}
Referred class should be a built-in class, or a registered plugin.
-
Copying from another object:
light light_name : extends another_light_name
{
intensity 100
}
New object will be a copy of referred object, with aditional changes
given. Obviously, it will be an object of the same class as referred object,
that must have been defined previously.
This three methods can be used to create (instantiate) a new object. You
can assign a name to the new object (as in previous examples), or left
it unnamed.
light : class WarnLight
{
...
}
If you don't want to instantiate a new object, but just use it as a template
to make copies of it, you can make a definition. To do this, you can use
any of the previous methods, preceded by the word 'define':
define light light_name : class WarnLight
{
...
}
In a definition, an object cannot be unnamed (a definition that cannot
be referred would be useless).
2. SCENE FILE STRUCTURE
[to be done...]
|