POV-Ray : Newsgroups : povray.binaries.images : not iso's (~100k) Server Time
2 Oct 2024 02:18:26 EDT (-0400)
  not iso's (~100k) (Message 1 to 3 of 3)  
From: hall
Subject: not iso's (~100k)
Date: 6 Jun 2000 00:00:55
Message: <393c7777@news.povray.org>
Started playing with a recursive macro.  Four demo images are included after
the example file:

#version unofficial MegaPOV 0.5;

light_source { <0,9,-1> 1 }
light_source { <3,2,-7> color rgb <.3,.3,.3>}

camera
{
 location <0,2,-5>
 look_at  <0,0,0>
}

#declare a=0; // level indicator.
//#declare obj_name=sphere{<0, 0, 0> .5 /*pigment{color rgb 1}*/}
//#declare obj_name=box{<.5, .5, .5> <-.5,-.5,-.5> /*pigment{color rgb 1}*/}
#declare obj_name=cylinder{<0,-1,0>,  <0,1,0>,  .25}
// c=0 if pigment in object declaration, 1 if pigment done inside macro.
#declare d=
pigment
{
 function{sqrt(x*x+y*y+z*z)/2}
 color_map
 {
  [0.000 color rgb <0,1,0>]
  [0.333 color rgb <0,0,1>]
  [0.667 color rgb <1,1,0>]
  [1.000 color rgb <0,1,0>]
 }
 turbulence .5
}
// d used if c=1.
// e=level maximum (integer value).
// f=number of sides of resulting figure (integer value).
#declare start=<0,0,0>;
// h=scale factor (vector or float)
// i=translate scale factor (float)
// j=descent step per level (positive values cause descent as level number
ascends).
// o=0 if object does not rotate before translation, 1 if rotates.

#macro polybumpgon(b,c,e,f,g,h,i,j,o)
        #if (a<e)
                #if (c=0)
                        object{b translate g}
                #else
                        object{b translate g pigment{d}}
                #end
                #local k=0;
                #while (k<f)
                        #declare a = a + 1;
                        #local l = <0,-1*j,1/(a*i)>;
                        #local l = vaxis_rotate(l,<0,1,0>,(360*k/f));
                        #local m = g + l;
                        #if (o=0)
                                #local n = object{b scale h }
                        #else
                                #local n = object{b scale h rotate
<0,(360*k/f),0> }
                        #end
                        polybumpgon(n,c,e,f,m,h,i,j,o)
                        #declare a = a - 1;
                        #local k = k + 1;
                #end
        #end
#end

polybumpgon(obj_name,1,6,4,start,<1.25,.8,1.25>,1,.1,0)


Quadhall
tre### [at] ww-interlinknet
--no matter where you go, there you are........


Post a reply to this message


Attachments:
Download 'plate_1.jpg' (25 KB) Download 'plate_2.jpg' (16 KB) Download 'plate_3.jpg' (19 KB) Download 'plate_4.jpg' (22 KB)

Preview of image 'plate_1.jpg'
plate_1.jpg

Preview of image 'plate_2.jpg'
plate_2.jpg

Preview of image 'plate_3.jpg'
plate_3.jpg

Preview of image 'plate_4.jpg'
plate_4.jpg


 

From: hall
Subject: Re: not iso's (~100k)
Date: 6 Jun 2000 06:38:47
Message: <393cd4b7@news.povray.org>
ooops..... here's a corrected form of the macro....and a demo image

#version unofficial MegaPOV 0.5;

light_source { <0,9,-1> 1 }
light_source { <3,2,-7> color rgb <.3,.3,.3>}

camera
{
 location <0,4,-4>
 look_at  <0,0,0>
}

#declare a=0; // level indicator.
//#declare obj_name=sphere{<0, 0, 0> .5 /*pigment{color rgb 1}*/}
//#declare obj_name=cylinder{<0,-1,0>,  <0,1,0>,  .25}
#declare obj_name=box{<.5, .5, .5> <-.5,-.5,-.5> /*pigment{color rgb 1}*/}
// c=0 if pigment in object declaration, 1 if pigment done inside macro.
#declare d=
pigment
{
 function{sqrt(x*x+y*y+z*z)/2}
 color_map
 {
  [0.000 color rgb <0,1,0>]
  [0.333 color rgb <0,0,1>]
  [0.667 color rgb <1,1,0>]
  [1.000 color rgb <0,1,0>]
 }
 turbulence .5
}
// d used if c=1.
// e=level maximum (integer value).
// f=number of sides of resulting figure (integer value).
#declare start=<0,0,0>;
// h=scale factor (vector or float)
// i=translate scale factor (float)
// j=descent step per level (positive values cause descent as level number
ascends).
// o=0 if object does not rotate before translation, 1 if rotates.
#declare begin=0;//initial rotation state of object.

#macro polybumpgon(b,c,e,f,g,h,i,j,o,p)
        #if (a<e)
                #if (c=0)
                        object{b translate g}
                #else
                        object{b translate g pigment{d}}
                #end
                #local k=0;
                #while (k<f)
                        #declare a = a + 1;
                        #local l = <0,-1*j,1/(a*i)>;
                        #local l = vaxis_rotate(l,<0,1,0>,(360*k/f)+p);
                        #local m = g + l;
                        #local q = (360*k/f)+p;
                        #if (o=0)
                                #local n = object{b scale h }
                        #else
                                #local n = object{b scale h rotate
<0,(360*k/f),0> }
                        #end
                        polybumpgon(n,c,e,f,m,h,i,j,o,q)
                        #declare a = a - 1;
                        #local k = k + 1;
                #end
        #end
#end

polybumpgon(obj_name,1,4,7,start,.8,1,.1,1,begin)


Post a reply to this message


Attachments:
Download 'plate_5.jpg' (18 KB)

Preview of image 'plate_5.jpg'
plate_5.jpg


 

From: David Fontaine
Subject: Re: not iso's (~100k)
Date: 6 Jun 2000 17:17:52
Message: <393D6977.B0FFE3DC@faricy.net>
Ah, I remember playing with this sorta thing :D

--
David Fontaine     <dav### [at] faricynet>     ICQ 55354965
Please visit my website: http://www.faricy.net/~davidf/


Post a reply to this message

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