Daniel Rivas Perpen

perpen

About Me

EXPERTISE
Hobbyist
INDUSTRY
Film/TV

Connect

LOCATION
United States
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Get point indices in prims with Python May 23, 2024, 7:06 p.m.

Hi,
This is what I use to avoid looping over the geometry in python (my example is strictly for triangles but you can modify it)

First add a string prim attribute with the vertices per primitve:
i[]@face_idx = primpoints(0, @primnum);
s@face_indices = string(itoa(i[]@face_idx[0]) + "," + itoa(i[]@face_idx[1]) + "," + itoa(i[]@face_idx[2]));

Then after that in a python geo node:
face_indices = np.array(geo.primStringAttribValues("face_indices"))
flat_list = ','.join(face_indices).split(',')
face_indices = np.array(flat_list, dtype=np.int32).reshape(-1,3)

Building fromNDC function for OpenCL Dec. 20, 2020, 6:21 p.m.

Hi,
I am trying to recreate the fromNDC VEX function in OpenCL. I successfully did this with the toNDC function following Mario's tutorial [www.sidefx.com]

However, I cannot seem to get fromNDC to work. Basically I invert the multiplication of the 2 matrices (cam and perspective projection) and then multiply it by the vector4 of the NDC coordinates, assuming 0 to 1 normalization.

Attached a project file with 2 wranglers, one with the fromNDC VEX function working properly and the other with my non working attempt.

Thanks!

Image Not Found

Outside in normals May 6, 2020, 12:59 p.m.

Oh man, thanks a lot!