POV-Ray : Newsgroups : povray.beta-test : Smaller Spheres : Re: Smaller Spheres Server Time
23 Jan 2022 19:14:52 EST (-0500)
  Re: Smaller Spheres  
From: Bald Eagle
Date: 16 Aug 2016 19:20:00
Message: <web.57b39f4dc5ad69015e7df57c0@news.povray.org>
Perhaps someone can try this and think of some improvements.

// random spheres
// for testing new smaller-sphere patch in 3.7.1.etc
// Bald Eagle 2016

#version 3.7;

global_settings {assumed_gamma 1.0}

#include "colors.inc"
#include "textures.inc"
#include "rand.inc"
#include "transforms.inc"

#declare Magnitude = 500;
camera {
 location <Magnitude, Magnitude, -Magnitude>
 look_at  <0, 0, 0>
}


light_source {<20, 50, -100> White shadowless}
//light_source {<0, 5, -1> White shadowless}

#declare R = 5;

//###############################################################

#declare _X = seed (123);
#declare _Y = seed (456);
#declare _Z = seed (789);



/*
// Other stuff to try to implement:
transform { translate { <x, y, z> } }
vtransform (Foo1, MyTransform);
Shear_Trans (X, Y, Z)
Matrix_Trans (X, Y, Z, Something)
Axial_Scale_Trans (Axis, Amt)
Axis_Rotate_Trans (Axis, Angle)
Rotate_Around_Trans(Rotation, Point)
Reorient_Trans(Axis1, Axis2)
Point_At_Trans(YAxis)
Center_Trans(Object, Axis)
Align_Trans(Object, Axis, Pt)
}
*/
#declare Stream = seed (123);

#declare Transforms = 20;
#declare Scale = 0.01;
#declare Radius = 5;

#for (Iteration, 1, 200)

 sphere {<0, 0, 0>, Radius

 #for (T, 1, Transforms)
  #declare Type = int(RRand(1, 3, Stream));
  #declare X = RRand(-90, 90, _X);
  #declare Y = RRand(-90, 90, _Y);
  #declare Z = RRand(-90, 90, _Z);

  #declare XS = RRand(0.5, 2, _X);
  #declare YS = RRand(0.5, 2, _Y);
  #declare ZS = RRand(0.5, 2, _Z);

  #switch (Type)
   #case(1) scale <XS, YS, ZS> #break
   #case(2) rotate <X, Y, Z> #break
   #case(3) translate <X, Y, Z> #break
  #end // end switch
 #end // end for T

  pigment {Blue} }
#end // end for Iteration


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.