Vormav Posted February 22, 2006 Share Posted February 22, 2006 I have come across a case where it would be useful to sort my vertices based on the angle between either the x, y or z axis, and the edge formed by the vertice and some center point (usually (0,0,0)). In other words, vertices would be sorted in a circular pattern, so that I could safely pass a range of these vertices off to an Add SOP to get a new, clean poly. Shouldn't be too big of a deal. I created a function that, given an axis to work off of, a center point, and the other point (the point being evaluated for the sort sop), returns that angle as a floating point number. The part where I think I'm getting mixed up is with how I'm passing along each point in the sort expression to my function. Right now, I'm trying to pass the data into the expression using point(".", $PT, "P", 0), but is $PT the right variable to be using within the context of the sort expression? Quote Link to comment Share on other sites More sharing options...
stevenong Posted February 23, 2006 Share Posted February 23, 2006 Yep, $PT is the right variable to use in the point() function. However, your expression needs to be modified as you can't call a point() onto the SOP itself. You have to reference an input SOP or other. For example, point("../input_SOP",$PT,"P",0) Cheers! steven Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 23, 2006 Share Posted February 23, 2006 The way you have it that expression, with steven's modification will just return the x position of the point, if you want it to use the attribute you have created you'd need to change "P" for your attribute name. Quote Link to comment Share on other sites More sharing options...
Vormav Posted February 25, 2006 Author Share Posted February 25, 2006 The world space position was actually I really needed. The problem Steve mentioned definitely was why I wasn't seeing any results though. Works perfectly now. Thanks. 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.