POV-Ray : Newsgroups : povray.general : Toroidal warp : Re: Toroidal warp Server Time
30 Jul 2024 20:28:07 EDT (-0400)
  Re: Toroidal warp  
From: Chris B
Date: 6 Jul 2008 17:45:53
Message: <48713d11$1@news.povray.org>
"SharkD" <nomail@nomail> wrote in message 
news:web.4871128da2e11e9c8c88ff560@news.povray.org...

> I meant the seam of the warp itself, not the texture.

Ah. Slightly more tricky :-).
I don't see any control on the warp itself that would do that for you 
(unless I'm wrong about the meaning of the orientation attribute), so I 
think you'll need a workaround.

> Consider the case where the image map is scaled first
> by a non-integer value.

The only thing that I can think of that will do this is to use a pigment_map 
with two copies of the pigment. One where the repeating scaled image_map is 
aligned to the origin (the default) and one where it's aligned to y=1. You 
can then use the pigment_map to join them wherever you want. In the example 
below I've placed the half-cut image at y=0.5 so that it appears around the 
outer rim of the torus. In this example I've cut a corner out of the torus 
just so that the inner rim and outer rim are both visible at the same time.

Regards,
Chris B.

camera {location <0,0,-124> look_at 0 }
light_source {<-1,30 ,-400>, rgb 3}

#local Torus_Radius = 64;
#local Scale_Factor = 1/10.5;

#declare MyPigment = pigment {
  image_map {png "YourImage.png"}
  scale Scale_Factor
}

difference {
  torus {Torus_Radius,20
    pigment {
      gradient y
      pigment_map {
        [0.0 MyPigment]
        [0.5 MyPigment]
        [0.5 MyPigment translate -y*Scale_Factor/2]
        [1.0 MyPigment translate -y*Scale_Factor/2]
      }
      warp { toroidal
        major_radius Torus_Radius
      }
    }
  }
  box {-y*30,<90,30,-90> pigment {rgbt 1}}
}


Post a reply to this message

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