Radial Sort In Line
I'd like to do a radial sort that apply an change on the first object and then increaingly all the way around till i reach the last object.
Check out the attached image to make more sense.
For example: I have an array of sphere and I'd like to change there diffuse color from white to black based on the radial array. Check out the image to make more sense. For the sake of the image i just did it by hand.
Thanks
JokerMartini
Attachment | Size |
---|---|
radialsort.png | 24.87 KB |
Comments
I need to figure out how to
I need to figure out how to return an array which is the order of splines in a shape, but in an order based on the radial sorting of the first knot in each spline.
I've hit this wall and I've been at it for the past few days and I'm now seeking some help from anyone. I hope that makes sense. I've attached an image to help explain incase your up for the challenge.
You may be wondering why I don't just create the splines in a radial order but that is because they are randomly created based off ob particle positions.
Anyways, the knot circled in red is just to show which knot is the first knot in the spline. The number by each spline shows which spline in the splineshape it is.
So ideally the returned array if radial sorted properly wold return this
#(1,3,5,6,2,7,4,8)
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
The Solution
Try this code on attachment file. Select any point helper and run code
bga
Great. Just what I needed.
Great. Just what I needed. Let me play around with this code and see what I can do.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Any?
Has anyone been able to find the best way to radial sort. These seem to only work if the objects are on the x and y.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Using Raphael js
Using Raphael js and Jsfiddle
http://jsfiddle.net/SquDT/
Thanks!
hey
Nice test result.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Idea
It would be cool to make a pickbutton allowing a user to choose the first object in the radial array to start from.
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
Results from Anubis's latest version
John Martini
Digital Artist
http://www.JokerMartini.com (new site)
haha, fun...
I end with very fun anim result using attached scene :) I see you loop through in input/unsorted array theObjects insted of sortedArray, but nm, forgot this version and read Garp notes.
my recent MAXScripts RSS (archive here)
Garp
Quick Testing result to see the ordering based on wirecolor
John Martini
Digital Artist
http://www.JokerMartini.com (new site)