Daniel Rivas Perpen

perpen

About Me

専門知識
Hobbyist
業界:
Film/TV

Connect

LOCATION
United States
ウェブサイト

Houdini Engine

Availability

Not Specified

Recent Forum Posts

Get point indices in prims with Python 2024年5月23日19:06

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 2020年12月20日18:21

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 2020年5月6日12:59

Oh man, thanks a lot!