I fail to correctly load a 3ds model with nested group hierarchy (and with own Pivots). Well, it loads and shows up correctly but the TransformGroups don't have the intended parent-child relation.

Please have a look at this small model Zip file. If you load the model with a 3ds viewer you see a base group named "Rumpf" which has got one child group named "Deckel":

If I load the model with the 3ds loader however, the following happens:(The naming of the live scenegraph does unfortunately not reflect the real names of the groups inside the 3ds file. Can't figure that out. Actually the Shape3D named "_Glied6" is the "Rumpf", and the Shape3D named "_Glied11" is the "Deckel".)

So what I see, in particular when I rotate/translate the two group's bottom level TransformGroups: the two group's PosTransform objects are both childs of the TDSModel. However "_Glied7" should be child of "_Glied5", isn't it?

PS: The pivot stuff is working. Meaning the group "Deckel"'s pivot is correctly shown (and it's not the same pivot which parent group "Rumpf" has got).

This is one of them times when I wish I'd written the loader from scratch instead of basing it off existing code. I don't know why you're getting this behaviour, more worryingly I'm not sure I understand the problem well enough to attempt to fix it.

Are you saying the Glied7 should appear as a child of Glied5?

If so, the current code is in know way set up to handle nested hiearchies like this (at least I don't think so).

This is one of them times when I wish I'd written the loader from scratch instead of basing it off existing code. I don't know why you're getting this behaviour, more worryingly I'm not sure I understand the problem well enough to attempt to fix it.

I know well that an 3d file importer is hard stuff. My congratulation to you for having managed to pack a basically working 3ds loader for Xith. Probably though, the so-called smaller details of these 3d files take the most time to add/correct/implement. :-(

Quote

Are you saying the Glied7 should appear as a child of Glied5?

Yes. Glied7 should be a child of the Glied2-group, so I think Glied7 to be a child of the Glied5 TG would be fine.When in the viewer I rotate or move the "Rumpf" group (= Glied1 group in Xith), the group "Deckel" (= Glied7 group in Xith) is attached to it and moves with it. You could also think of some more sub groups, all being childs of the parent. Like the famous "body - arm - hand" nested hierarchy explained in the Xith3d tutoral (ASE loading).

Quote

If so, the current code is in know way set up to handle nested hiearchies like this (at least I don't think so).

Bombadil, I am trying to implement something similar you have on your screenshot. But, I am having some difficulties in visually selecting an object.

I detect a pick from the user, and create a box geometry and move it to the place where the objected picked is located. Is this a good approach? Is that how you do it?

I've not yet done visual selection of the obejcts (the 1st screenshot is from a 3ds viewer). I'll do this soon. Probably I'll try to highlight the selected node/Shape3D by changing its Appearance object.

If you want to draw a bounding box on the selected node I think your approach is OK. I've tried to set the node's showBounds(.., ..) but it doesn't look nice for selection purposes. :-)

Kevin, I try to use your TDSModel.getNamedObject("Name") method but I don't yet understand its results.With the above example model I call model.getNameObject("Deckel") and get a TransformGroup object. Nice, but it's not "_Glied10" what I get, but another one (without a node name).Which TransformGroup of the model's hierarchy do you return? (refering to that 2nd screenshot avove.)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org