ChargingImage Posted June 22, 2015 Share Posted June 22, 2015 (edited) Hello! Cant find answer anywhere on forums (too obvious?) How to create points per face? Or force copy (or emission attribute for particles), to use center of the polygon. Foreach node? I'm trying to do similar effect like in this topic: http://www.orbaz.com/forum/viewtopic.php?t=2275&postdays=0&postorder=asc&highlight=align&start=15 In this 3ds max setup center of the spawn point is kind of cheated - it's just Y mult 0.5 (thus Z in Houdini). THEN, I'll need to align along normal, and probably "find loop", or any other technique that will align them in one direction. Edited June 22, 2015 by ChargingImage Quote Link to comment Share on other sites More sharing options...
acey195 Posted June 22, 2015 Share Posted June 22, 2015 (edited) the point creation can be very easilly done with 2 promote sops and an attribute wrangle, which is way faster than a forloop. in the promote sop promote attribute P from point to primitive (rename the attribute to avP and uncheck delete original attribute) add a facet node to create some base point normals add another promote attribute promote attribute N from point to primitive (rename the attribute to avN and again uncheck delete original attribute) then in the wrangle do something like this (set the operation to run over primitives): /// removeprim(0,@primnum,1); int centerPoint = addpoint(0,v@avP); setpointattrib(0,"N",centerPoint,v@avN,"set"); /// aligning the points with the surface will be bit harder, but even in the example you have shown, it seems to be just a constant up vector. Edited June 22, 2015 by acey195 1 Quote Link to comment Share on other sites More sharing options...
ChargingImage Posted June 24, 2015 Author Share Posted June 24, 2015 (edited) Thank you for help! I'll try this today. edit: what is v@avP, especially "av" part. It's working wihtout it, but you use it twice. I presume you want to create vector named avP... probably to show it I would need to make custom visualisation... Am I thinking good? another problem is: how to promote or copy N from prims into new points? I've tried changing class, or work on prim and points - but then N was gone prom details. Edited June 24, 2015 by ChargingImage Quote Link to comment Share on other sites More sharing options...
Robert Posted June 24, 2015 Share Posted June 24, 2015 v@avP is a notation for attributes in the attribwrangle (CVEX) context. v@ means it's a vector attribute. avP is the attribute he created earlier in the attribpromote node. This attribute was the average position of all the points that make up a single primitive. If you average all corners you get the center. In the wrangle node he is creating a point for each face at the position of v@avP, which is its center. He is setting the N from the original primitives to the newly created points using the avN attribute. This attribute too was created earlier with the attribpromote by averaging the normals of the points for each primitive. Quote Link to comment Share on other sites More sharing options...
acey195 Posted June 24, 2015 Share Posted June 24, 2015 Thanks for explaining Robert, I guess VEX can be a bit hard to get in to at first, so you may want to try attribute VOPs (VEX in node form) if that is more your style. 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.