POV-Ray : Newsgroups : povray.binaries.images : Frist try at...(109KB) : Re: Frist try at...(109KB) Server Time
8 Aug 2024 18:15:16 EDT (-0400)
  Re: Frist try at...(109KB)  
From: dlm
Date: 20 May 2005 21:33:27
Message: <428e8fe7@news.povray.org>
Stefan,
Perhaps the problem is your POV rather than your math?
Try keeping track of your last pos and drawing a cylinder between points 
instead of all those smushed up spheres!
You may prefer to make an object of the cylinder collection.
i.e. modify your code to look a bit like this.
DLM

#declare radius_fixed = 1;
#declare radius_rotating = 4;
#declare spiro_offset = 1;

#declare my_degrees = 0.0;
#declare x_loc =0;
#declare y_loc =0;
#declare x_loc_o =0;
#declare y_loc_o =0;
#declare z_loc = 0;
//#declare z_fac = 0.0025;

#while (my_degrees < 360)
  #declare x_loc_o =x_loc;
  #declare x_loc = (radius_fixed + radius_rotating) * cos(my_degrees / 
57.3) -
  (radius_rotating + spiro_offset) * cos((((radius_fixed + radius_rotating) 
/
  radius_rotating)) * (my_degrees /*/ 57.3*/));

  #declare y_loc_o =y_loc ;
  #declare y_loc = (radius_fixed + radius_rotating) * sin(my_degrees / 
57.3) -
  (radius_rotating + spiro_offset) * sin((((radius_fixed + radius_rotating) 
/
  radius_rotating)) * (my_degrees /*/ 57.3*/));

  cylinder {
    <x_loc_o,y_loc_o,z_loc>,<x_loc,y_loc,z_loc>,0.025  //0.25
    material {
      texture {
        pigment {
          color Red
        }
      }
    }
  }




"Stefan Viljoen" <spa### [at] polardcom> wrote in message 
news:428e330c@news.povray.org...
>A first try at a spirogram a la Shay.
>
> Total failure, but nonetheless something mildly interesting.
>
> Anybody got code that does nice spirographs? Shay?
>
> I tried implementing the algo at Mathworld, but obviously lacking in the
> math department.
>
> Lots of possibilities posed by this - most obvious is a "plekmatjie" in my
> language - something that your granny would put the kettle on. Or over the
> kettle.
>
> Source in p.b.s.f.
>
> Things to try - bring in some Z, colors, transparency, blobs, and other
> objects - a world of possibilities.
>
> Comments welcome or use in your own scenes. From a greater distance makes 
> a
> lice little round knitted tea-cosy or something.
> -- 
> Stefan Viljoen
> Software Support Technician / Programmer
> Polar Design Solutions


Post a reply to this message

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