ghang Posted November 22, 2009 Share Posted November 22, 2009 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 Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted November 22, 2009 Share Posted November 22, 2009 You have to loop thru all points. Do this with forEach, Copy+Stamp or, like in example, with VOPS. normalsPointingAtOnePoint.hipnc Quote Link to comment Share on other sites More sharing options...
SpencerL Posted November 22, 2009 Share Posted November 22, 2009 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) Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted November 22, 2009 Share Posted November 22, 2009 hi Swann, i very much like your solution, can you please be so kind to explain your VOP setup? i'm quite new to VOPS so it would be a great help for me! regards, Manuel Quote Link to comment Share on other sites More sharing options...
ghang Posted November 22, 2009 Author Share Posted November 22, 2009 thanks very very very much for the reply and solution both is nice and useful, it helps me alot. thanks Quote Link to comment Share on other sites More sharing options...
sanostol Posted November 23, 2009 Share Posted November 23, 2009 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 Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted November 23, 2009 Share Posted November 23, 2009 (edited) 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 November 23, 2009 by SWANN Quote Link to comment Share on other sites More sharing options...
asnowcappedromance Posted November 23, 2009 Share Posted November 23, 2009 (edited) 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 November 23, 2009 by asnowcappedromance Quote Link to comment Share on other sites More sharing options...
sanostol Posted November 23, 2009 Share Posted November 23, 2009 @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 Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted November 23, 2009 Share Posted November 23, 2009 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. 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.