From 4149fa6cc1413316c2a695d509276ce7b9004acd Mon Sep 17 00:00:00 2001 From: Tonton Th Date: Mon, 29 Jun 2026 15:59:11 +0200 Subject: [PATCH] randomize des poteaux --- incs/poteaux.inc | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/incs/poteaux.inc b/incs/poteaux.inc index 671a3ae..462ee3f 100644 --- a/incs/poteaux.inc +++ b/incs/poteaux.inc @@ -20,37 +20,40 @@ texture { New_Penny scale 0.3 } // ----------------------------------------------------------------- -#declare Base_Poteau_1 = object -{ +#macro Base_Poteau_1 (Foo) union { box { <-1, 0, -1>, <-0.08, 1.6, 1.5> } box { <0.08, 0, -1.5>, <1, 1.6, 1> } + texture { + pigment { color Gray75 } + #local R = rand(RND); + #if (R < 0.50) normal { bumps 0.333 } + #else normal { dents 0.333 } + #end // if R + } } -texture - { - pigment { color Gray75 } - normal { bumps 0.333 } - } -} +#end // macro -#declare Bois_Poteau_1 = object -{ +#macro Bois_Poteau_1 (Foo) union { cylinder { <0, 0, 0>, <0, 20, 0>, 0.42 } cone { <0, 20, 0>, 0.64, <0, 21, 0>, 0.21 } cylinder { <-4, 19, 0>, <4, 19, 0>, 0.20 } + #local R = rand(RND); + #if (R < 0.76) texture { T_Wood12 rotate x*90 scale 3 } + #else texture { T_Wood14 rotate x*90 scale 3 } + #end } -texture { T_Wood12 rotate x*90 scale 3 } -} +#end // macro #declare Poteau_1 = object { union { - object { Base_Poteau_1 } - object { Bois_Poteau_1 } + object { Base_Poteau_1 (0) } + object { Bois_Poteau_1 (0) } } }