Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (494)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 transport object names ?  (Read 3798 times)
0 Members and 1 Guest are viewing this topic.
Offline BrainPlug

Senior Newbie





« Posted 2005-08-22 13:41:37 »

Hello everybody,

I have a geometry in a 3DS file that I want to load with the 3DS-Loaders from "www.newdawnsoftware.com".
I want to import this scene and later
adjust the positions of some of the 3d-objects. But I found out, that the names
of the Shape3Ds that represent the objects, are empty Strings
( <Shape3D>.getName() ). I really need this names to determine wich Shape3D
represents which 3D-object.

Has anyone any suggestions ??

best regards

Marc
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2005-08-22 14:41:16 »

Eeep, you mailed me direct about this one too didn't you?

I'll try and take a look tonight unless anyone else has any initial suggestions (croft?)

Kev

Offline croft

Junior Member




Java, Java, Java


« Reply #2 - Posted 2005-08-22 18:07:54 »

I'll try and take a look tonight unless anyone else has any initial suggestions (croft?)


Do you want to me to hold off on working on org.xith3d.loaders.tds while you address this issue?  I can work on org.xith3d.loaders.md2 in the interim.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2005-08-22 23:48:02 »

Na, its fine, I imagine this is a tiny patch. If only I hadn't spent all night playing about.

Kev

Offline hawkwind

Junior Member




Java games rock!


« Reply #4 - Posted 2005-08-23 00:30:15 »

Croft

   You obviously have been making some big strides in adding and extending some Xith capabilities.  Do you have any plans on putting some of what you have done, the original stuff  for the whoola browser, into xith.  Behaviors for example??  Are there any other goodies  in that tool?
Offline croft

Junior Member




Java, Java, Java


« Reply #5 - Posted 2005-08-23 18:16:35 »

   You obviously have been making some big strides in adding and extending some Xith capabilities.  Do you have any plans on putting some of what you have done, the original stuff  for the whoola browser, into xith.  Behaviors for example??  Are there any other goodies  in that tool?


Yes, eventually.

I've got a Loader almost ready to contribute that delegates to one of the other New Dawn Software loaders which is chosen based on the filename extension such .obj, .md2, or .3ds.  I was thinking about putting it in package org.xith3d.loaders and giving it a name such as MultiLoader or DefaultLoader or somesuch.  Any suggestions for the name of this class?

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2005-08-23 18:36:01 »

How about ModelLoader ?

Kev

Offline croft

Junior Member




Java, Java, Java


« Reply #7 - Posted 2005-08-23 20:48:44 »

How about ModelLoader ?

Is there a design pattern that describes this kind of thing?

Here is what I have so far:
http://cvs.sourceforge.net/viewcvs.py/whoola/core/src/com/whoola/core/media/xith/XithLoader.java?rev=1.3&view=auto

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline hawkwind

Junior Member




Java games rock!


« Reply #8 - Posted 2005-08-24 01:03:46 »

I am assuming that you have tested the loaders accessing jar embedded files, accessed using a MyClass.class.getResource()  type thing??
Offline Niwak

Senior Member


Medals: 1
Projects: 1



« Reply #9 - Posted 2005-08-24 06:31:30 »

There is actually an existing pattern in the Java API core for image IO (look for IIORegistry and ImageIO and the ServiceProviderInterface associated in the Java API reference).

It can be easily adapted to be used for model loading (that's what I do in my engine).

The benefit is that new loaders are automatically detected when a jar is added to the application class-path.

Another benefit is that you can use the same pattern for Models, Textures and Image loading and therefore everything looks easier.

           Vincent
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline croft

Junior Member




Java, Java, Java


« Reply #10 - Posted 2005-08-24 22:44:07 »

I am assuming that you have tested the loaders accessing jar embedded files, accessed using a MyClass.class.getResource()  type thing??

Yes, getClass().getClassLoader().getResource() works for both OBJLoader2 and MD2Loader2.  Your message prompted me to do extensive testing today and everything worked fine.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline croft

Junior Member




Java, Java, Java


« Reply #11 - Posted 2005-08-24 22:48:48 »

Another benefit is that you can use the same pattern for Models, Textures and Image loading and therefore everything looks easier.

Do you know if that design pattern has a name?

I made the multi-loader extensible.  You can now map additional filename extensions to additional loaders at runtime.  What to call it, though?  How about "ExtLoader" for extensible, filename extension loader?  I'm also leaning toward "MultiLoader".

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline croft

Junior Member




Java, Java, Java


« Reply #12 - Posted 2005-08-24 22:55:00 »

Na, its fine, I imagine this is a tiny patch. If only I hadn't spent all night playing about.

Are you currently working on that?  I am ready to start working on TDSLoader2 tomorrow but I want to make sure we are both not hacking on it at the same time.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2005-08-25 07:50:12 »

Go ahead and work on it. I'll take a look once you're done (I'll want to anyway Smiley).

Kev

Offline croft

Junior Member




Java, Java, Java


« Reply #14 - Posted 2005-08-25 18:30:55 »

Go ahead and work on it. I'll take a look once you're done (I'll want to anyway Smiley).


I took a look.  Looks kind of scary.  It turns out I don't have a bunch of 3DS models lying around in the company archive so I my incentive to scratch this particular itch is diminished.  I am going to postpone indefinitely on this one.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline BrainPlug

Senior Newbie





« Reply #15 - Posted 2005-08-27 11:32:00 »

it's me again ....

Remeber me and my problem ?  Sad

In the meantime I found out, there is this class "ModelContext" where all information found out by the "ChunkProcessor"s is stored. But i cant find the place where the real  "Shape3D"s (that can be found later in the TDSModel) are created.

greetz Marc
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #16 - Posted 2005-08-29 13:29:13 »

In NamedObjectProcessor.java - 

the bit of code that reads:

1  
2  
3  
        context.object = new TransformGroup();
        context.shape  = new Shape3D();
        context.shape.setAppearance(new Appearance());


could be changed to:

1  
2  
3  
4  
        context.object = new TransformGroup();
        context.shape  = new Shape3D();
        context.shape.setName(context.objectName);
        context.shape.setAppearance(new Appearance());


Might work?

Kev

Offline BrainPlug

Senior Newbie





« Reply #17 - Posted 2005-08-31 13:22:34 »

Hi,
thank you for coming back to my problem ..... in the meantime i solved it by myself.

It is not enough to insert the line

  context.shape.setName(context.objectName);

because the Shape3D will be copied later with

<com.xith3d.scenegraph.Node>.sharedCopy(<Shape3D>)

and the made copy will be attached to the scenegraph. This method does NOT copy the name of the given node and that was the problem. So I changed the method a bit and it worked.

anyway .... thanks for your help :-)
Offline arne

Senior Member




money is the worst drug- we should not let it rule


« Reply #18 - Posted 2005-08-31 14:25:41 »

I think it would be now problem if you would commit your changes - or if this is too much work - simply give the line numbers and the changes, so croft, kev or whoever has already got developer acces can also change that while he's editing the code anyways.

:: JOODE :: Xith3d :: OdeJava ::
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #19 - Posted 2005-08-31 14:49:22 »

Um, I would say thats a fault with Xith core tho, shared copy does maintain names?

What happens when you want to duplicate your model - you can no longer access its sub-parts.

Kev

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #20 - Posted 2005-09-01 00:59:42 »

I agree this is a bug in Xith3D.  I have commited a change to sharedCopy so it now also copies names.

Kev should your change also be committed?

Cheers,

Will.

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #21 - Posted 2005-09-01 08:13:22 »

Yep, would make sense to store the names from the 3DS.

Nice quick turn around time, well done William!

Kev

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #22 - Posted 2005-09-01 12:33:13 »

Thanks Smiley  I have commited this change then too.

Cheers,

Will.

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.

Dwinin (21 views)
2014-09-12 09:08:26

Norakomi (55 views)
2014-09-10 13:57:51

TehJavaDev (66 views)
2014-09-10 06:39:09

Tekkerue (33 views)
2014-09-09 02:24:56

mitcheeb (54 views)
2014-09-08 06:06:29

BurntPizza (38 views)
2014-09-07 01:13:42

Longarmx (24 views)
2014-09-07 01:12:14

Longarmx (30 views)
2014-09-07 01:11:22

Longarmx (28 views)
2014-09-07 01:10:19

mitcheeb (37 views)
2014-09-04 23:08:59
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!