Livello

L’ordine con cui appaiono le chiamate delle regole influenza l’ordine con cui le figure saranno renderizzate e quindi gli effetti di sovrapposizione

Il quadrato nero, disegnato per ultimo si trova al livello più alto

startshape LIVELLO

shape LIVELLO 
{ 
    SQUARE [ x -1.50  y -1.50  brightness 0.6 ] 
    SQUARE [ x -1.50  y +1.50  brightness 0.6 ] 
    SQUARE [ x +1.50  y -1.50  brightness 0.6 ] 
    SQUARE [ x +1.50  y +1.50  brightness 0.6 ] 
    SQUARE [ x -0.75  y -0.75  brightness 0.3 ] 
    SQUARE [ x -0.75  y +0.75  brightness 0.3 ] 
    SQUARE [ x +0.75  y -0.75  brightness 0.3 ] 
    SQUARE [ x +0.75  y +0.75  brightness 0.3 ] 
    SQUARE [                                  ]
}

Se si vuole spostare indietro il quadrato nero bisogna spostare la chiamata corrispondente prima delle altre

startshape LIVELLO

shape LIVELLO 
{ 
    SQUARE [                                  ]
    SQUARE [ x -1.50  y -1.50  brightness 0.6 ] 
    SQUARE [ x -1.50  y +1.50  brightness 0.6 ] 
    SQUARE [ x +1.50  y -1.50  brightness 0.6 ] 
    SQUARE [ x +1.50  y +1.50  brightness 0.6 ] 
    SQUARE [ x -0.75  y -0.75  brightness 0.3 ] 
    SQUARE [ x -0.75  y +0.75  brightness 0.3 ] 
    SQUARE [ x +0.75  y -0.75  brightness 0.3 ] 
    SQUARE [ x +0.75  y +0.75  brightness 0.3 ] 
} 

Per ottenere un effetto qualsiasi con i livelli, senza dover ristrutturare il codice è possibile utilizzare il parametro z che specifica a quale livello sarà renderizzata una figura rispetto alle altre

Alcuni valori di z sono superflui, rispetto all’effetto voluto, ma sono stati specificati per completezza

startshape LIVELLO

shape LIVELLO 
{ 
    SQUARE [                   z  0                 ]
    SQUARE [ x -0.75  y -0.75  z +1  brightness 0.3 ] 
    SQUARE [ x -0.75  y +0.75  z -1  brightness 0.3 ] 
    SQUARE [ x +0.75  y -0.75  z -1  brightness 0.3 ] 
    SQUARE [ x +0.75  y +0.75  z  0  brightness 0.3 ] 
    SQUARE [ x -1.50  y -1.50  z  0  brightness 0.6 ] 
    SQUARE [ x -1.50  y +1.50  z -1  brightness 0.6 ] 
    SQUARE [ x +1.50  y -1.50  z -2  brightness 0.6 ] 
    SQUARE [ x +1.50  y +1.50  z +2  brightness 0.6 ] 
}

Lascia un commento