Author Topic: Sorting  (Read 14857 times)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Sorting
« on: August 25, 2023, 09:21:05 pm »
This is more of a programming question than a jpct question. But since it's for sorting the bones I'm importing off of GLB in jpct, this is as good a place as any to ask it. So I'm writing a 2d skeleton viewer. Each bone knows its parent, and that's about all the information I have on them. Since I know it's a bipedal skeleton generated with Mixamo, I know the skeleton's shape. All I need is to sort the bones and draw them out. I'm doing this to verify that the parent/child relationship is accurate. What's the best way to run through the 2d List<Bone> and produce a sorted array? Now that I asked the question I realize that it's not a linear list, it's a tree. Any ideas?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12297
    • View Profile
    • http://www.jpct.net
Re: Sorting
« Reply #1 on: September 11, 2023, 07:42:41 am »
Sorry for the late reply...not sure on what metric to sort such a thing, though. As you've mentioned, it doesn't seem to be a list. And a tree would most likely reflect the parent-child relationship.