Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  3ds loader: grouping trouble  (Read 1621 times)
0 Members and 1 Guest are viewing this topic.
Offline Bombadil

Senior Duke





« Posted 2004-03-15 06:18:45 »

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).
Online kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2004-03-15 06:57:48 »

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).

Kev

Offline Bombadil

Senior Duke





« Reply #2 - Posted 2004-03-15 07:25:09 »

Quote
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).

Ah well, that explains a lot. :-)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline pedro

Junior Duke




Java games rock!


« Reply #3 - Posted 2004-03-16 03:05:17 »


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?

If you, or anyone else, could give some insight on this I would much appreciate.

tnx.
Offline Bombadil

Senior Duke





« Reply #4 - Posted 2004-03-16 11:03:37 »

Quote

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. :-)
Offline Bombadil

Senior Duke





« Reply #5 - Posted 2004-03-16 11:09:39 »

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.)

Thanks.



PS: Concerning nested hiearchy groups - the Walker.3ds.zip has tons of them. :-)
Online kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2004-03-16 12:14:14 »

I'd imagine in your case it'd be 7, but I haven't got access to the code right now.

Kev

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (35 views)
2014-10-17 03:59:02

Norakomi (26 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (27 views)
2014-10-15 16:18:58

TehJavaDev (52 views)
2014-10-14 00:39:48

TehJavaDev (54 views)
2014-10-14 00:35:47

TehJavaDev (42 views)
2014-10-14 00:32:37

BurntPizza (63 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (76 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!