POV-Ray : Newsgroups : povray.binaries.images : Adding on to wireframe_torus .. WireTorus.jpg (17.1 KB) Server Time
2 Oct 2024 10:21:42 EDT (-0400)
  Adding on to wireframe_torus .. WireTorus.jpg (17.1 KB) (Message 1 to 1 of 1)  
From: Hugh S  Steele
Subject: Adding on to wireframe_torus .. WireTorus.jpg (17.1 KB)
Date: 27 Apr 2000 13:05:23
Message: <39087353@news.povray.org>
Hi all..  Just creeping in with a little addition to the to wireframe_torus
that was posted before.  Drove me nuts, until i remembered to convert to
radians.  :-}  Getting old...


#include "colors.inc"

background{ DimGray }

camera{ location <100, 200, 300> look_at <0, 0, 0> }

light_source{   0 color White shadowless}
light_source{ 300 color White shadowless}


#macro WireTorus( pMajor, pMinor, pWire, pMajorCnt, pMinorCnt )
  #union
  {
    #local lAdjust = 360 / pMajorCnt;
    #local lTemp = 0;

    #while( lTemp < pMajorCnt )
      #local lAngle = (lTemp * lAdjust);

      #local lX = pMinor * cos( radians( lAngle ));
      #local lY = pMinor * sin( radians( lAngle ));

      torus
      {
        lY + pMajor, pWire
        translate <0, lX, 0>
      }
      #local lTemp = lTemp + 1;
    #end

    #local lAdjust = 360 / pMinorCnt;
    #local lTemp = 0;

    #while( lTemp < pMinorCnt )
      torus
      {
        pMinor, pWire
        rotate <90, 0, 0>
        translate <pMajor, 0, 0>
        rotate <0, (lTemp * lAdjust), 0>
      }
      #local lTemp = lTemp + 1;
    #end
  }
#end

object{ WireTorus( 100, 25, 5, 5, 40 )  texture{ pigment{ Blue }}}


--
Hugh S. Steele

--
The light you see at the end of the tunnel
     is from the train about to hit you.


Post a reply to this message


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

Preview of image 'WireTorus.jpg'
WireTorus.jpg


 

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