POV-Ray : Newsgroups : povray.general : Emergency help: Can someone teach me how to make spirals? : Re: Emergency help: Can someone teach me how to make spirals? Server Time
7 Jan 2025 23:38:19 EST (-0500)
  Re: Emergency help: Can someone teach me how to make spirals?  
From: yesbird
Date: 3 Jan 2025 23:24:23
Message: <6778b7f7@news.povray.org>
On 04/01/2025 05:49, DD123 wrote:
> Hello everyone,
> ...
> Can someone teach me how to create spirals exactly like figure 1?

This way, maybe:

//----------------------------------------------------
#include "colors.inc"
#include "shapes.inc"

global_settings {ambient_light 2*White}

camera {
location <6, 9, -13> / 2.5
look_at <0, 0.8, 0>
angle 45}

background { color rgb <0.2, 0.22, 0.2> }

light_source{< -300, 300, -300> color White}
light_source { <-5, 10, -20> color White shadowless}

#declare Ball =
  sphere{ <0,0,0>,0.15 scale <1,1,1> rotate<0,0,0> translate<0,0,0>
	 texture{ pigment{ color rgb<1,0.7,0>}
                  finish { phong 1}}}

union{
  #local Nr = 0;            // start
  #local N_per_Rev = 500;   // Number of Elements per revolutions
  #local N_of_Rev  = 4.00;  // Total number of revolutions
  #while (Nr< N_per_Rev*N_of_Rev)
    object{Ball translate<1,Nr*0.45/N_per_Rev,0>
                rotate<0,Nr * 360/N_per_Rev,0>}

  #local Nr = Nr + 1;    // next Nr
  #end // ---------------  end of loop
rotate<0,0,0>
translate<0,0,0>
}
//----------------------------------------------------

This one of loop example, see more in POV-Ray UI:
Menu / Insert / Loop ...
--
YB


Post a reply to this message


Attachments:
Download 'spiral.png' (84 KB)

Preview of image 'spiral.png'
spiral.png


 

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