A parametric, texture-mapped surface of spherical topology: a sphere that can be twisted, pinched and sheared, and cut down to a patch in theta and phi.
Ported from Gled, whose parameter names it keeps.
The geometry is built on the client, by makeSMorph in EveElementsRCore.js. The surface is textured and REveRenderData has no channel for texture coordinates, so only the parameters are streamed.
The surface is generated at unit size. Radius, position and orientation are in the element's transformation, so changing them streams one matrix under kCBTransBBox and the client rebuilds nothing. Every other setter stamps kCBObjProps and forces a rebuild.
The parametrisation, with ct = cos(theta), st = sin(theta):
twist = ct * fTx, conv = ct * fCx x = ct y = (1 + conv) * st * cos(phi + twist) z = (1 + conv) * st * sin(phi + twist)
followed by a rotation about z through x * fRz, which shears the body along its polar axis. The polar axis is x, as in the original. The normal is the normalised position, which is exact for the unmorphed sphere and approximate for small fTx, fCx and fRz.
Texture coordinates:
u = fTexX0 + fTexXC * phi / 2pi v = fTexY0 + fTexYC * acos(ct) / pi
A non-zero fTexYOff adds int(v) * fTexYOff to u, which offsets successive wraps into a brick bond.
Worked example: tutorials/visualisation/eve7/boing.C.