Cylindrical UV Projections with VEX

calendar_today

01.07.2023

label

Texturing

mouse

Houdini 18.5

Description

Cylinidrical and Spherical texture projections in VEX.

1 Cylindrical projection

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

C
        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

C
        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);
    
link

Related articles

favorite

267

label

Texturing

Accumulating the amount of daylight

favorite

276

label

Texturing

Blending object colors into a texture map

favorite

331

label

Texturing

Camera projection to a curved screen

favorite

269

label

Texturing

Camera visibility texture

favorite

274

label

Texturing

Mapping caustics from 3D meshes

favorite

255

label

Texturing

Circular Color Gradients in VOPs