I'm trying to get the bounds of a given object, then orient that bounding box so that the +Z normal looks at a target, but still properly bounds the object.
I can get the bounds to look at (or away from) a target with a Copy To Points node, feeding a point into port0 and a target into port1 of an attribute wrangle with the following VEX code:
vector @N;
vector source = point (0, "P", @ptnum);
vector target = point (1, "P", @ptnum);
@N = normalize(source-target);
v@up = set(0,1,0);
...but of course that invalidates the bounds.
Any tips on how to get the bounds of an object, leverage the code above to look-at a target and maintain proper bounds, all in a single attribute wrangle? I can't figure it out. Neither can ChatGPT.
I'll attach a GIF and a HIP.
Thank you in advance.