Cylindrical UV projections with VEX

calendar_today

01.07.2023

label

Texturing

mouse

Houdini 18.5

1 Cylindrical projection

Equirectangular projection: https://en.wikipedia.org/wiki/Equirectangular_projection

vector pos = normalize(v@P);

float u = atan2(pos.x, pos.z) / (2.0 * PI) + 0.5;
float v = pos.y * 0.5 + 0.5;

v@uv = set(u, v, 0.0);

2 Spherical projection

Cylindrical equal-area projection: https://en.wikipedia.org/wiki/Cylindrical_equal-areaprojection

vector pos = normalize(v@P);

float u = (atan2(pos.x, pos.z) / PI + 1.0) / 2.0;
float v = asin(pos.y) / PI + 0.5;

v@uv = set(u, v, 0.0);