www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: AGP on August 25, 2023, 09:21:05 pm

Title: Sorting
Post by: AGP 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?
Title: Re: Sorting
Post by: EgonOlsen 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.