// sun surface /* General: $phideg = 90: vertical up! $thetadeg = 0; east! $thetadeg = 90; south! $thetadeg = 180; west! $thetadeg = 270; north! sunposition copenhagen: Altitude max: 57 deg. Altitude min: 10 deg (the building is placed in the city, so the building isn't affected by the direct sun before it's 10 deg over the horizon) */ /* Create the polygon and make sure it's called: pCube1 or replace pCube1 with the name of the polygon. RUN THIS PART FISRT */ int $iteratings = 60000; select -r pCube1; rotate -r -os 0 -88.5 0 ; select -r pCube1.vtx[0:2098] ; string $verticesall[]; $verticesall = `filterExpand -sm 31 -ex true`; ////////////////////////////////////////////////////////////////////////////////////////////////////// // SELECT THE VERTICES NOT TO BE AFFECTED AND RUN THE REST OF THE SCRIPT ///////////////////////////////////////////////////////////////////////////////////////////////////// string $items[] = `filterExpand -sm 31 -ex true`; string $diff[] = stringArrayRemove($items, $verticesall); for( $i=0; $i<$iteratings;$i++) { int $randvtx = rand(0,size($diff)); select -r $diff[$randvtx]; /////////////////////////////////////get point//////////////////////////////////////////////// float $theta; float $thetadeg; float $phi; float $phideg; float $radius; $radius = 0.1; $thetadeg = rand(54.0,305.0); $phideg = rand(10.0,52.0); $theta = `deg_to_rad $thetadeg`; $phi = `deg_to_rad $phideg`; $x = $radius * cos($phi) * cos($theta); $y = $radius * cos($phi) * sin($theta); $z = $radius * sin($phi); ////////////////////////////////////////////////////////////////////////// move -r $x $z $y; }