The solution is indeed related to trigonometric functions.
Not sure what you want exactly, though... You have a picture that goes around the cylinder and you want a (x,y) -> (x',y) mapping?
I think? Ha, I can't comment much on proper notation sorry. But yes, if that means what it looks like it means (an image with an x,y determining its 'size' having its x value modified) then yah.
I totally get it if my description is lacking or difficult to follow. I'll try again.
I need some function to apply to a width_scaling number. In that diagram there's an image that is 30 pixels wide. The image will be rendered on screen by multiplying its fixed width (30) with a 'width_scaling' value which will range from 0 to 1 (so, 0 pixels wide to 30 pixels wide).
The space which the image occupies will be the 'room'. The room is 600 pixels wide. Any value 'x' for the purposes of this description only corresponds to the horizontal position in that room. The leftmost edge of the room is x=0, the rightmost x=600. If our image has x=300, we're saying that is in the centre of the room, horizontally (not that its image is now 300 pixels wide).
Our image is created at x=520, with image_scaling=0. It will linearly reduce its own x value at a fixed rate, such that the image travels left on the screen. At creation, the image has image_scaling=0. This image_scaling value will tend, um... inverse exponentially(?) toward 1 as the image moves toward the centre of the room. At the centre, x=300, image_scaling=1 (no squishing of the image's width). The image will carry on traveling left as its x decreases, this time the value image_scaling will decrease exponentially back toward 0 as the image's position appraoches x=80. Image_scaling=0 at this point.
What then is the function for image_scaling which matches the visual illusion of a rotating cylinder (a poster stuck on the wall of rotating drum, for example, when viewed directly from the side).
(I'm worried I made the question worse.
)
EDIT: Thanks for that reply. I see now that I missed an important detail, sorry.
It isn't one single texture. Let's say the visible space is 600 wide. And there is a cylinder with width 440 in the centre (giving 'empty space' of 80 to the left and right). The image I'm manipulating is only, say, 40 in width. Basically a tile. I should have just said tile initially, ha. I will create the illusion of the entire cylinder by repeating this tile such that, together, they cover the whole 440 diameter of the cylinder.
EDIT2: Threw down a quick gif of the single tile being created at a rightmost wall, traveling toward the left and being destroyed. Obviously the width_scaling is very wrong, hence the request for guidance. Just a single oscillation is what I'm looking for, wrapped around the centre point.
Link to .gif
(My intuition tells me that, as long as I can solve this single tile, I should be able to fill the 'wall of the cylinder' with an appropriate number of evenly-spaced tiles and the cylinder's total diameter will stay constant. Does that seem right?)