POV-Ray : Newsgroups : povray.general : Toroidal warp : Re: Toroidal warp Server Time
30 Jul 2024 20:21:39 EDT (-0400)
  Re: Toroidal warp  
From: SharkD
Date: 6 Jul 2008 14:45:00
Message: <web.4871128da2e11e9c8c88ff560@news.povray.org>
"Chris B" <nom### [at] nomailcom> wrote:
> The code below should place the horizontal seam on the outside. The warps
> take the image from the square <0,0,0> to <1,1,0>, so moving it up by 0.5*y
> causes the seam to be positioned where the middle of the image was before.
> The bottom half is filled in because the image_map generates an infinite
> number of copies butted end to end, so you end up seeing the top half of one
> copy and the bottom half of the original.
>
> I don't think the orientation setting does what you think it does. When you
> change it from z to -z, I think it just makes it look at the image from the
> other side. You also seemed to have a lot more translations and rotations
> than you need. Just by translating the image you can move both the
> horizontal and vertical seams around the torus.
>
> Regards,
> Chris B.
>
> camera {location <0,28,-204> look_at 0 }
> light_source {<-1,30 ,-400>, rgb 3}
>
> #local Torus_Radius = 64;
> torus {Torus_Radius,20
>   pigment {
>     image_map {png "yourimage.png"}
>     translate y*0.5
>     warp { toroidal
>       major_radius Torus_Radius
>     }
>   }
> }

Sorry, I wasn't clear enough in my previous post. I meant the seam of the warp
itself, not the texture. Consider the case where the image map is scaled first
by a non-integer value. The result is that the image gets wrapped around the
torus in such a way that it doesn't repeat by an amount equal to a whole
number. There will be portions where the texture is "split" and meets at points
other than the image's edges. Using the example you gave, consider this:

#local Torus_Radius = 64;
torus {Torus_Radius,20
  pigment {
    image_map {png "yourimage.png"}
    // integer scaling
    // scale 1/3
    // non-integer scaling
    scale 1/3.1
    warp { toroidal
      major_radius Torus_Radius
    }
  }
}

If you'll notice along the inner edge of the torus, you'll see that the "edge"
of the image appears twice in close proximity, accounting for the 0.1
difference in the scaling factor. What I would like to do is move this edge
where the image meets itself to the outside of the torus. I haven't yet figured
out a way of doing this.

-Mike


Post a reply to this message

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