POV-Ray : Newsgroups : povray.advanced-users : "Exploded" vector transform : Re: "Exploded" vector transform Server Time
20 Apr 2024 08:20:09 EDT (-0400)
  Re: "Exploded" vector transform  
From: Kenneth
Date: 5 Aug 2017 19:40:01
Message: <web.598656975219365e883fb31c0@news.povray.org>
I think the method to go about it would depend on two things: 1) if the objects
have *already* been made and pre-positioned, or not; and 2) the relative sizes
of the objects. You didn't mention that the many objects may have different
sizes; that would complicate things.

*IF* your're making a group of objects from scratch, and ALL of the same size,
then this simple code would suffice--although, I have a funny feeling that this
is WAY too simplistic for the idea you have in mind ;-)  Offhand, I don't have a
good idea for adding equal spacing between objects of *different* sizes. I would
imagine that it would involve finding the sizes of the objects' bounding boxes
first, using max_extent, then... ??


#version 3.71;

global_settings{assumed_gamma 1.0}
#default {texture{pigment {rgb 1} finish{ambient 1 emission 0 diffuse 0}}}

camera {
  perspective
  location  <28, 16, -300>
  look_at   <28, 16,  0>
  right     x*image_width/image_height
  angle 16
}

#declare CX = 0;
#declare CY = 0;
#while(CY < 30)
#while (CX < 30)
sphere{0,.25
translate <-9,-14,0> // just to offset the objects arbitrarily, before
// re-positioning them
translate 1*<CX,CY,0>} // simply change the multiplier!
#declare CX = CX + 1;
#end
#declare CX = 0;
#declare CY = CY + 1;
#end


Post a reply to this message

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