michael Posted May 31, 2003 Share Posted May 31, 2003 I asked about something like this in the character section and while MCronin refered me to a thread I don't think it's really what I'm after... in the attached file there is: a curve and an add the curve goes into a group then into a point the add just has a transform what I'd like is to find an expression to use in the group sop that finds the closest point on the curve and then feeds that into the point sop which will move it based on the position of the add's xform I've looked at pointdist() and xyzdist() but they'll only return a primitive# and not the point#... hoop_02_test.hipnc Quote Link to comment Share on other sites More sharing options...
Wolfwood Posted June 1, 2003 Share Posted June 1, 2003 Try the nearpoint() expression. In the textport "exhelp nearpoint". Or you could read up on it in the expression reference....oh wait...its not in there. jim. Quote Link to comment Share on other sites More sharing options...
edward Posted June 1, 2003 Share Posted June 1, 2003 Or, you could hack something with the Ray SOP set to Minimum Distance. Quote Link to comment Share on other sites More sharing options...
michael Posted June 2, 2003 Author Share Posted June 2, 2003 thanks guys, I'll look into it in the morning Quote Link to comment Share on other sites More sharing options...
michael Posted June 3, 2003 Author Share Posted June 3, 2003 nearpoint works really well....at least when I toggle the expression it seems to be returning the nearest point....but now the group sop claims there are 9 points in the group - all the points in the curve... in the above hip file I'm using: nearpoint("/obj/geo1/curve1", ch("/obj/geo1/xform1/tx"), ch("/obj/geo1/xform1/ty"), ch("/obj/geo1/xform1/tz")) Quote Link to comment Share on other sites More sharing options...
michael Posted July 17, 2003 Author Share Posted July 17, 2003 just wanted to bump this back into the land of the living... I really don't understand why the expression in the group1 works (gives the right point #) but when I MMB on the group it says that there are 9 points in the group > there should just be one > from the nearpoint() expression. hoop_04_post.hipnc Quote Link to comment Share on other sites More sharing options...
plan9 Posted August 4, 2003 Share Posted August 4, 2003 there is also xyzdist() ill get a small sample up when i get the chance Quote Link to comment Share on other sites More sharing options...
michael Posted August 4, 2003 Author Share Posted August 4, 2003 thanks! I think xyzdist() will only return the primitive #, not the point # Quote Link to comment Share on other sites More sharing options...
Dries Posted August 4, 2003 Share Posted August 4, 2003 I took a look at your hipfile. You are using the filter expression with the nearpoint expression. Your nearpoint expression returns the number 2. So the expression will always be true. What houdini does in the filter expression is effectively 2=2 which is always true for every point of your geometry. So all the points will be in your group. You need to use a condition. So $PT==nearpoint(blablabla) is what you're after. Also, you don't need to use a transform sop and reference that. You can use the add just like you started, click on a point, fill in the coordinates and reference those channels. Copy the channels and look on your clipboard for the actual name. (Expand the horizontal bar just above your parameters). It's just neater like that. DRie.s Quote Link to comment Share on other sites More sharing options...
plan9 Posted August 4, 2003 Share Posted August 4, 2003 thanks!I think xyzdist() will only return the primitive #, not the point # yah you will create a couple attributes, it is using the variable you created as a result of xyzdist() ...primuv() is getting the point nfo. ill do a small sample which will make more sense Quote Link to comment Share on other sites More sharing options...
michael Posted August 8, 2003 Author Share Posted August 8, 2003 well I'm still stuck on this... using the conditional works really well (thanks again Dries) to find the closest point, but now i can't figure out how to get a smoother deformation in the curve and how to prevent it 'snapping' when a new CV is selected... I think I've gone about this the wrong way but I don't really know how else to do it.... here is the file with comments hoop_05.hipnc Quote Link to comment Share on other sites More sharing options...
FrankFirsching Posted August 8, 2003 Share Posted August 8, 2003 If you want such a smooth deformation, the attempt of grouping the point with minimal distance is the wrong way. A global approach is better. You would need to add a custom point-attribute on the curve, which stores a weight for deformation. This is based on the distance of each point to the reference-position from the xform1-SOP and the smooth-expression. This weight can then be used to pull the vertices of the curve. But this is rather compicated and here is another proposal: Use a metaball and the magnet-SOP to deform the curve. You can control the size and weight of the metaball in order to achieve a good deformation. Take a look at the hip-file attached. hoop.zip Quote Link to comment Share on other sites More sharing options...
michael Posted August 8, 2003 Author Share Posted August 8, 2003 thanks Frank... th first method I tried used a metaball...but it didn't really work the way I wanted, your solution looks much better.... 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.