I’ve been playing around with the bend modifier in Max. I want to write a vertex program to take a plane (displaced already by some random amount) and wrap it into a cylinder. I cannot quite work out how to do this as my maths isn’t very good.
If the cylinder is along the origin it’s simple. The displacement is the cylinder vertex position x,y (optionally normalized) times the height field for that vertex. If you don’t have a height field then displacement will be y - base height.
All in all it’s pretty simple, although I may not have sed the same axes you need, your diagram isn’t labeled.
Well, the way i’ve done it currently is to generate a cylinder mesh with the same dimensions as the notional plane - then moved the vertices along the vector towards the central axis of the cylinder by their displacement. This works but what I want to do is have all of my program reason about the space on the plane (which is easier than reasoning about the cylinder) and then just use a vertex program to wrap it into a cylinder. This is for an industrial imaging application.
Then my control can be either (1) a heightfield representation of the data or (2) a more realistic representation of the object we are imaging, which has cylindrical geometry.
You said you are using Max? Just install the SDK. The code for most of the modifiers is in the SDK. Just open up the bend project and see what max does.