galagast Posted November 11, 2021 Share Posted November 11, 2021 Hello~ Anyone knows of a quick way to convert the Bounding Box display of a Packed Primitive Geometry into Polygon? Currently, i'm looking into just building a box based the packed intrinsics (transform and bounds) XD Quote Link to comment Share on other sites More sharing options...
Atom Posted November 11, 2021 Share Posted November 11, 2021 (edited) You can still use the bound node on a packed primitive. That will give you six polygons and remove the packed primitive from the stream. Edited November 11, 2021 by Atom Quote Link to comment Share on other sites More sharing options...
galagast Posted November 11, 2021 Author Share Posted November 11, 2021 heya Atom! yeah, i actually tried that.. i should have also mentioned that i wanted it to also be correctly oriented based on the packed prim orientation >__< Quote Link to comment Share on other sites More sharing options...
galagast Posted November 11, 2021 Author Share Posted November 11, 2021 So far, this one worked create_attributes (run over points) matrix ident = ident(); addpointattrib(0, "transform", ident, "matrix"); get_intrinsic_attributes (run over points) int pt = addpoint(0, {0,0,0}); // get bound size float bounds[] = primintrinsic(0, "packedbounds", @ptnum); float size_x = abs(bounds[0]-bounds[1]); float size_y = abs(bounds[2]-bounds[3]); float size_z = abs(bounds[4]-bounds[5]); vector scale = set(size_x, size_y, size_z); // set transform matrix tm = primintrinsic(0, "packedfulltransform", @ptnum); vector pos = primintrinsic(0, "pivot", @ptnum); pretranslate(tm, pos); prescale(tm, scale); setpointattrib(0, "transform", pt, tm); removeprim(0, @primnum, 1); 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.