hoknamahn Posted February 6, 2009 Share Posted February 6, 2009 I have to promote primitve class attributes into point one. Do we have any facility in HDK to do this? I see only void GEO_VertexAttribDict::promoteAttrib(const char * n, int s, GB_AttribType type) Promote an attribute to the vertex dictionary. Or shall I find out which polygons are sharing the point and just do the sampling / interpolation manually? Cheers. Quote Link to comment Share on other sites More sharing options...
hoknamahn Posted February 6, 2009 Author Share Posted February 6, 2009 (edited) If anyone is interested... findPrimsUsingPoint(pt, primlist, prefarr) operation is very expensive and not very useful in this particular case. But I have found a pretty fast solution: instead of baking an attribute as primitive attribute (in "for all polygons" pass) we can bake this attibute into each point of the polygon with addition (ptAttrib += val). Also we have to create a counter attribute (cntAttrib += 1). In second pass (i.e. "for all points") we just have to divide ptAttrib by cntAttrib and we are done. It's fast but if somebody knows "one line" or faster or more proper solution please tell about it. Edited February 6, 2009 by hoknamahn 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.