POV-Ray : Newsgroups : povray.binaries.images : Torus that Once was Twisted (22KB) : Re: Torus that Once was Twisted (22KB) Server Time
26 Apr 2024 03:08:55 EDT (-0400)
  Re: Torus that Once was Twisted (22KB)  
From: Tor Olav Kristensen
Date: 5 Jul 2000 21:07:48
Message: <3963DB48.510E862F@online.no>
Moon47 wrote:
> 
> Wow... I like it... What did you do...?

Thank you, but I didn't do much.

I just modified some of Peter's translation 
and rotation statements with some cosine values.


See code below.

Tor Olav
--
mailto:tor### [at] hotmailcom
http://www.crosswinds.net/~tok/tokrays.html


#declare Steps = 1500;
#declare MajorRad = 10;
#declare MinorRad = 2;
#declare Turns = 5;

#declare Circumference = 2*pi*MajorRad;
#declare Thickness = 5*Circumference/Steps;

#declare dDegStep = 360/Steps;
#declare dRadStep = 2*pi/Steps; 

#declare TwistedTorus =
blob {
  threshold 1
  #declare Cnt = 0;
  #while (Cnt < Steps)
    #local RadCnt = Cnt*dRadStep;
    #local DegCnt = Cnt*dDegStep;
    sphere {
      0, 3, 0.125
      scale <2*MinorRad, MinorRad*0.5, Thickness>
      translate x*MinorRad
      rotate 12*cos(Turns*RadCnt)*z
      translate MajorRad*x + MinorRad/8*cos(Turns*RadCnt)*y
      rotate (DegCnt + 8*cos(Turns*RadCnt))*y
    }
    #declare Cnt = Cnt + 1;
  #end
  sturm
}


Post a reply to this message

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