Jump to content

Point per Face / making scalemail


Recommended Posts

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

 

face_align_working_144.jpg

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 by ChargingImage
Link to comment
Share on other sites

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 by acey195
  • Like 1
Link to comment
Share on other sites

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 by ChargingImage
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...