Jump to content

How To make many points Normals point to 1 object?


ghang

Recommended Posts

hi

i would like to know how to let many points's normals point to 1 point or object , with Point SOP?

i not sure about the expression in POINT SOP > Add Normals

($TX2 - $TX)

($TY2 - $TY)

($TZ2 - $TZ)

this expression is only work for 1 point, means 1 points normals point to the object, but others points didnt

i would like to make multi point normals point to the point as the image attach bellow.

thanks

post-4016-125888266153_thumb.jpg

Link to comment
Share on other sites

Actually, a much faster way of doing this is to just subtract the current position of each point ($TX, $TY, $TZ) from the point you want to point to by using the point() expression. If you want all your Normals to point to point number 10 then put this in a point SOP > N

$TX - point(opinputpath("."), 10, "P", 0)
$TY - point(opinputpath("."), 10, "P", 1)
$TZ - point(opinputpath("."), 10, "P", 2)

Link to comment
Share on other sites

Hi Swann, You don't need looping in VOP in this case, just subtract the global variable P from the inported P of the second input, plug it into the normal output and You are done.

martin

I always forgot that I can just plug Global PTNUM directly into ptnum of ImportAttrib and forgot about everything.

Thanks

PS. Still waiting for third part of your Volume Blog :).

can you please be so kind to explain your VOP setup?

NO

Just kidding :). This is the same like when you use pointSOP and substract one input from another. Just here, instead of $TX etc, you have to import attribut P first and then do substraction. Since I wanted to do substraction for every point I used forLoopVOP and there imported P of thos escatttered points. Basicaly forLoop repeat some task for each point, so in this case it taked point zero and substracted it from addSOP point, than taked point one and substracted it from addSOP point... and it just looped till it gone thru every point. Number of loops is defined by global Ptnum that is plugged into Initial Value and End Value. Plug printVOP into PTNUM and turn it ON. You will see that it prints all points starting from zero! and each point will be paired with this addSOP point and substracted. But as Sanastol mentioned you don't have to do this. Just import P of first input from PTNUM and substract from it addSOP point P and it's done.

Edited by SWANN
Link to comment
Share on other sites

Okay, got it, very nice! And the print VOP is great, first time i heard of this node, very helpful!

hmm 2 questions remain:

1.

In your example you plug "ptnum" into the "i" AND the "end" of the ForLoop VOP. Why is that?

As Ptnum is the current processed point number, shouldn't be a constant "number of points - 1" value be plugged

into the end value????

2.

quick question: In VOP SOPs one uses the Import Attribute VOP to access attributes of the geometry,

is there a similar VOP in the shader VOP VEX context? The only VOP i know that can import attributes

is the Shading Layer Parameter VOP, but it gives me only access to uv, Cd and Alpha.

thanks,

Manuel

Edited by asnowcappedromance
Link to comment
Share on other sites

@2. use a parameter vop it will fetch attributes from the geometry

Okay, got it, very nice! And the print VOP is great, first time i heard of this node, very helpful!

hmm 2 questions remain:

1.

In your example you plug "ptnum" into the "i" AND the "end" of the ForLoop VOP. Why is that?

As Ptnum is the current processed point number, shouldn't be a constant "number of points - 1" value be plugged

into the end value????

2.

quick question: In VOP SOPs one uses the Import Attribute VOP to access attributes of the geometry,

is there a similar VOP in the shader VOP VEX context? The only VOP i know that can import attributes

is the Shading Layer Parameter VOP, but it gives me only access to uv, Cd and Alpha.

thanks,

Manuel

Link to comment
Share on other sites

Okay, got it, very nice! And the print VOP is great, first time i heard of this node, very helpful!

hmm 2 questions remain:

1.

In your example you plug "ptnum" into the "i" AND the "end" of the ForLoop VOP. Why is that?

As Ptnum is the current processed point number, shouldn't be a constant "number of points - 1" value be plugged

into the end value????

Start and end values should be the same, but not always. Sometimes you want to exit from loop and don't process all data because you don't need it.

Example: don't process points that are not visible in camera etc.

But in such repetitive task like this or like in FlatternPoints tool you will use the same number in start and end.

Houdini help: "Be careful when using this operator to ensure that the condition will eventually be met. Otherwise an endless loop can result. Such endless loops can be interrupted within Houdini, but can result in renders that never finish."

Propably you will use some testing before you plug value into end slot. Just to make sure that endless loop will not happen.

2.

quick question: In VOP SOPs one uses the Import Attribute VOP to access attributes of the geometry,

is there a similar VOP in the shader VOP VEX context? The only VOP i know that can import attributes

is the Shading Layer Parameter VOP, but it gives me only access to uv, Cd and Alpha.

thanks,

Manuel

Use ParameterVOP. If attribute exists on your geometry it will pickup it at the rendering stage.

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...