0

I am looking for some information on how to "bend" an arbitrary list of points/vertices similar to the bend modifier you can find in typical 3D modelling programs.

I want to provide a list of points, a rotation focal point, and a "final angle." For my purposes, I will always be saying "points at minimum y of the set will not change, points at maximum y will be rotated at the maximum angle, everything in between is interpolated."

Example Image of starting configuration and desired result, given a 90 degree rotation:

img

Can anyone suggest a resource that would explain how to go about this? I'm prepared to code it (C++) but I'm wracking my brain on a concept that would make this work. It would be easy to generate the vertices, but the application I'm writing this for takes in user-created content and needs to bend it.

(Edited to add: I don't need a miracle matrix or deep equation solution... if you say something like "for each vertex, do this" that's good enough to get the green checkmark)

Thanks!

Spektre
  • 49,595
  • 11
  • 110
  • 380
KiraHoneybee
  • 495
  • 3
  • 12

1 Answers1

1

You seem to be transforming a straight line to a circular arc, preserving distances between adjacent points.

So, if the point A is the one you want to hold constant, pick another point B to be the center of that circle. (The nearer B is to A, the more severe the bending.) Now for any point C you want to transform, break the vector C-B into the component parallel to A-B (call that component R) and the component perpendicular to it (call that k). The magnitude of R will be the radius of the circle you map C to, and you can transform the magnitude of 'k' into distance along that circle:

theta = |k|/|R|
C` = B + R cos(theta) + k|R|/|k| sin(theta)
Beta
  • 96,650
  • 16
  • 149
  • 150