POV-Ray : Newsgroups : povray.binaries.animations : Textured flexible cylinder Server Time
14 Oct 2024 06:58:37 EDT (-0400)
  Textured flexible cylinder (Message 1 to 3 of 3)  
From: Cousin Ricky
Subject: Textured flexible cylinder
Date: 26 Apr 2024 13:15:52
Message: <662be148@news.povray.org>
Attached is a cylinder bent around a circular arc.

How did I get the texture to follow the bend?  Easy: I spent 3 days
throwing spaghetti at a wall until all of it stuck.

I have to do this every time I use the cylindrical warp.  I can explain
all about how POV-Ray handles gamma and sRGB, but warp { cylindrical }
is still black magic to me.

The code will be in the next major release of DeskLamp.


Post a reply to this message


Attachments:
Download 'test_flex_texture.mp4.dat' (123 KB)

From: Bald Eagle
Subject: Re: Textured flexible cylinder
Date: 26 Apr 2024 21:05:00
Message: <web.662c4e91703632a81f9dae3025979125@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> Attached is a cylinder bent around a circular arc.
>
> How did I get the texture to follow the bend?  Easy: I spent 3 days
> throwing spaghetti at a wall until all of it stuck.
>
> I have to do this every time I use the cylindrical warp.  I can explain
> all about how POV-Ray handles gamma and sRGB, but warp { cylindrical }
> is still black magic to me.
>
> The code will be in the next major release of DeskLamp.

Well, to be fair, you're doing one of those Cousin-Ricky level things that I
often find myself doing.

Cylindrical means cylindrical.
And you're deviating from that to toroidal.

If I had to guess the best way to do that, it would be by geometric inversion.
Your cylinder would be a torus of infinite radius, and then you'd translate it
relative to the center of inversion until you got a torus with the desired major
radius.

Dunno if recounting my cylindrical warp woes will help you any:

http://news.povray.org/povray.bugreports/thread/%3Cweb.5c01b8a81374e197765e06870%40news.povray.org%3E/

Excellent job getting it all to work!
I'm sure it must have been a hard slog to the finish line.

- BE


Post a reply to this message

From: Cousin Ricky
Subject: Re: Textured flexible cylinder
Date: 26 Apr 2024 21:53:34
Message: <662c5a9e$1@news.povray.org>
On 4/26/24 21:02 (-4), Bald Eagle wrote:
> 
> Cylindrical means cylindrical.
> And you're deviating from that to toroidal.

My intended task was to bend a solid texture into an arc.  That it is
applied to a torus is incidental.  I can't even begin to imagine dealing
with warp { toroidal }.  (What you see in the animation is a solid
checker pattern.  If I were dealing with uv-mapping, of course I would
have used toroidal.)

> If I had to guess the best way to do that, it would be by geometric inversion.
> Your cylinder would be a torus of infinite radius, and then you'd translate it
> relative to the center of inversion until you got a torus with the desired major
> radius.

I suppose if I were doing those calculations myself, I'd at least know
what I was doing.  But without thinking too hard about it, it seems like
an overly convoluted and unnecessarily difficult way to get it done.
The main difficulty with warp { cylindrical } was getting all the parts
oriented and scaled properly, but the end code is remarkably simple, if
somewhat head-scratching.

FWIW, I did work from the center of curvature, then translate.  And of
course, the unbent object (which does not appear in this animation,
because it is between frames) is a special case using a straight
cylinder, because infinite radii and translations are not fun.

> Excellent job getting it all to work!
> I'm sure it must have been a hard slog to the finish line.

Thanks!


Post a reply to this message

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