// Relationals must be within parentheses // Return arithmetic value 0 for false or 1 for true // < <= = != >= > i.e.: #declare BallColor = pigment { red (clock > 0.5) } // black or red // Relational expressions: // (A < B) A is less than B // (A <= B) A is less than or equal to B // (A = B) A is equal to B (actually abs(A-B)=EPSILON) // (A >= B) A is greater than or equal to B // (A > B) A is greater than B // As logical operators there are '&' and '|' standing for // logical AND and OR. // (A & B) true only if both A and B are true, false otherwise // (A | B) true if either A or B or both are true // They return arithmetic value 0 for false or 1 for true. // Note that A and B are not handled bitwise but logical. #if (A & B) ... // do this only if both A and B are true #else // optional ... // do this only if both A and B are false #elseif ( Cond ) // optional ... // do this only if both A and B are false and Cond true #end #if (A | B) ... // do this if either A or B is true #end #ifdef ( IDENTIFIER ) ... // do this only if both A and B are true #end #ifndef ( IDENTIFIER ) ... // do this only if both A and B are true #end #undef IDENTIFIER //