I would really like to be able to set a value with a named variable.
E.g.
set j 6
mat
rule mat {
j * { x 1 hue 20 } j * { y 1 hue 20 } split
}
instead of:
rule mat {
6 * { x 1 hue 20 } 6 * { y 1 hue 20 } split
}
This would make localizing the users control of the variances more controllable by defining these at the head of the file. (and one day maybe in the UI)
Is this possible please ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The preprocessor will do pure text substitution (so there will be no dynamic variables - only constants).
I'll do this because I've been playing around with an embedded JavaScript interpreter, in order to control and automate the rendering (for instance it should be possible to control the camera and some variables and create an automated process which renders frames for an animation).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would really like to be able to set a value with a named variable.
E.g.
set j 6
mat
rule mat {
j * { x 1 hue 20 } j * { y 1 hue 20 } split
}
instead of:
rule mat {
6 * { x 1 hue 20 } 6 * { y 1 hue 20 } split
}
This would make localizing the users control of the variances more controllable by defining these at the head of the file. (and one day maybe in the UI)
Is this possible please ?
Yes. Actually the next thing I'll do is to add simple constant variables.
I'll do it by adding a preprocessor step, using a syntax like:
-----------
#define angle 120
R1
rule R1 {
{ z 1 rz angle } R1
Sphere
}
----------
The preprocessor will do pure text substitution (so there will be no dynamic variables - only constants).
I'll do this because I've been playing around with an embedded JavaScript interpreter, in order to control and automate the rendering (for instance it should be possible to control the camera and some variables and create an automated process which renders frames for an animation).
I've added preprocessor substitutions - the code is checked in in the SVN repository.
Example:
/*
An example of using preprocessor defines
*/
#define sizeStep 0.98
#define angle 4
set maxdepth 400
R1
R2
rule R1 {
{ x 1 rz angle ry angle s sizeStep hue 1 a 0.97 } R1
{ s 2 } sphere
}
rule R2 {
{ x -1 rz angle ry angle s sizeStep hue -1 sat 1 a 0.97 } R2
{ s 2 } sphere
}