Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2] 3
  ignore  |  Print  
  Adding the newdawn loaders to the distribution  (Read 9759 times)
0 Members and 1 Guest are viewing this topic.
Offline croft

Junior Devvie




Java, Java, Java


« Reply #30 - Posted 2005-08-17 18:03:01 »

I do, but a good design is more important and it won't be a big problem to change the code. But I think when we want to improve the design, we'll also have to think about Scene. As an example Scene got a function "getBehaviors()", but in Xith3d we don't use Behavior classes, or does anybody? And Scene hasn't got a function like "playFrame(int n)" which we would need for animations.

I'm a big fan of sticking to the Java 3D API which is why I like implementing interface Loader by extending LoaderBase.

I use Behaviors, including Scene.getBehaviors():
http://cvs.sourceforge.net/viewcvs.py/whoola/core/src/com/whoola/core/media/xith/behavior/

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

Junior Devvie




Java, Java, Java


« Reply #31 - Posted 2005-08-17 18:11:16 »

I don't think there is a problem with interface changes at this stage -- nobody is using these loaders at the moment from the org.xith3d package anyway  since they were only just added.  The most important goal for now is having the best design possible Smiley

Ah, OK.  I will feel free to break as required.  I'm going to go with interface Loader as it can load from a URL, Reader, or file.  The capability to read from a URL is particularly handy as it can be used to find resources on the classpath using ClassLoader.getResource() which returns a URL argument.  You can also use a URL to reference files via HTTP and the filesystem (file:/C:/....).

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

Senior Devvie




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


« Reply #32 - Posted 2005-08-17 18:41:18 »

Wow they work!?! - cool - I always thought they would be there from the "xith to be as much Java3D like as possible"-times and I never thought, they were fully implemented - you know empty method stubs and stuff.

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

Junior Devvie




Java, Java, Java


« Reply #33 - Posted 2005-08-17 21:28:04 »

Wow they work!?! - cool - I always thought they would be there from the "xith to be as much Java3D like as possible"-times and I never thought, they were fully implemented - you know empty method stubs and stuff.

I had to write my own bits and pieces for what I needed for Behaviors.


OK, I was able to modify OBJLoader to get it to load from a baseURL.  I tested using a baseURL that was pointing to the file system (file:///C:/Documents%20and%20Settings/.../shuttle.obj).  It successfully loaded.

I committed it as OBJLoader2 so that it would not cause problems with people using OBJLoader and to make it easy to back out if necessary.  Once finalized, we can overwrite OBJLoader and remove OBJLoader2.

I also created a MaterialLibLoader2 that uses TextureLoader2.  OBJLoader2 uses MaterialLibLoader2.  The changes to MaterialLibLoader2 were necessary since TextureLoader2 lets you load from an arbitrary URL.

I am going to continue working on OBJLoader2 and MaterialLibLoader2 over the next few days as I integrate and test with applications.  Feel free to take a look and post comments:
https://xith-tk.dev.java.net/source/browse/xith-tk/src/org/xith3d/loaders/obj/

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

Junior Devvie




Java, Java, Java


« Reply #34 - Posted 2005-08-17 22:53:07 »

I am in the process of moving the 3DS, OBJ and MD2 Newdawn loaders in to the xith-tk shared CVS as planned.

I am having trouble compiling org.xith3d.loaders.tds.TexMapProcessor.  It looks like it is relying upon a previous version of com.xith3d.scenegraph.Texture.

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

JGO Coder


Projects: 2


Fire at will


« Reply #35 - Posted 2005-08-18 00:38:47 »

Wow they work!?! - cool - I always thought they would be there from the "xith to be as much Java3D like as possible"-times and I never thought, they were fully implemented - you know empty method stubs and stuff.
I had to write my own bits and pieces for what I needed for Behaviors.

Is this something that can/should be added to the core?  A lot of people have been asking for this!

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #36 - Posted 2005-08-18 00:39:23 »

I do, but a good design is more important and it won't be a big problem to change the code. But I think when we want to improve the design, we'll also have to think about Scene. As an example Scene got a function "getBehaviors()", but in Xith3d we don't use Behavior classes, or does anybody? And Scene hasn't got a function like "playFrame(int n)" which we would need for animations.
I'm a big fan of sticking to the Java 3D API which is why I like implementing interface Loader by extending LoaderBase.

Good point.  I agree.

Will.

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #37 - Posted 2005-08-18 00:43:42 »

I am in the process of moving the 3DS, OBJ and MD2 Newdawn loaders in to the xith-tk shared CVS as planned.

I am having trouble compiling org.xith3d.loaders.tds.TexMapProcessor.  It looks like it is relying upon a previous version of com.xith3d.scenegraph.Texture.

Hmm what exactly is your problem (i.e. error message)?   The TDS loader compiles here fine (thought I havn't updated with your new changes yet).

Cheers,

Will.

Offline croft

Junior Devvie




Java, Java, Java


« Reply #38 - Posted 2005-08-18 18:07:31 »

Hmm what exactly is your problem (i.e. error message)?   The TDS loader compiles here fine (thought I havn't updated with your new changes yet).


Here is where I am hitting the trouble spot:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
    [javac] C:\external\xith-tk\src\org\xith3d\loaders\tds\TexMapProcessor.java:72: cannot find symbol
    [javac] symbol  : method getFormat()
    [javac] location: class com.xith3d.scenegraph.Texture
    [javac] if ((textureMap.getFormat() == Texture.RGB) && (context.transparency == 0)) {
    [javac] ^
    [javac] C:\external\xith-tk\src\org\xith3d\loaders\tds\TexMapProcessor.java:72: cannot find symbol
    [javac] symbol  : variable RGB
    [javac] location: class com.xith3d.scenegraph.Texture
    [javac] if ((textureMap.getFormat() == Texture.RGB) && (context.transparency == 0)) {
    [javac] ^


I'm guessing the getFormat() method and the RGB constant were removed from Texture recently.

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

Junior Devvie




Java, Java, Java


« Reply #39 - Posted 2005-08-18 18:09:57 »

Is this something that can/should be added to the core?  A lot of people have been asking for this!

Yes.  Let me ease into that one over time as I get more experience.

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 William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #40 - Posted 2005-08-19 01:40:44 »

Hmm what exactly is your problem (i.e. error message)?   The TDS loader compiles here fine (thought I havn't updated with your new changes yet).


Here is where I am hitting the trouble spot:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
    [javac] C:\external\xith-tk\src\org\xith3d\loaders\tds\TexMapProcessor.java:72: cannot find symbol
    [javac] symbol  : method getFormat()
    [javac] location: class com.xith3d.scenegraph.Texture
    [javac] if ((textureMap.getFormat() == Texture.RGB) && (context.transparency == 0)) {
    [javac] ^
    [javac] C:\external\xith-tk\src\org\xith3d\loaders\tds\TexMapProcessor.java:72: cannot find symbol
    [javac] symbol  : variable RGB
    [javac] location: class com.xith3d.scenegraph.Texture
    [javac] if ((textureMap.getFormat() == Texture.RGB) && (context.transparency == 0)) {
    [javac] ^


I'm guessing the getFormat() method and the RGB constant were removed from Texture recently.

Correct, the Texture class was refactored to better account for mipmap textures.  I didn't notice the error as I hadn't updated my Eclipse loaded version of Xith3D with the recent texture changes

I have made the nessesary changes to the 3DS loader, so please cvs update.

Incidently, this is one of the good reasons for having code such as this in the xith-tk -- the code is kept up to date by the Xith3D maintainers whenever something changes.

Cheers,

Will.

Offline croft

Junior Devvie




Java, Java, Java


« Reply #41 - Posted 2005-08-19 20:17:14 »

I have made the nessesary changes to the 3DS loader, so please cvs update.

OK, thanks, that did the trick.

OBJLoader2 and MaterialLibLoader2 are now stable.  I was able to successfully test by using them in the Whoola 3D Browser.  Any comments or suggested changes to the code from those tracking?  If none, I will use the modified classes to overwrite the original OBJLoader and MaterialLibLoader sometime next week.  I will then move on to the MD2 and 3DS loaders.

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

Junior Devvie




Java, Java, Java


« Reply #42 - Posted 2005-08-23 20:56:25 »

OBJLoader2 and MaterialLibLoader2 are now stable.  I was able to successfully test by using them in the Whoola 3D Browser.  Any comments or suggested changes to the code from those tracking?  If none, I will use the modified classes to overwrite the original OBJLoader and MaterialLibLoader sometime next week.  I will then move on to the MD2 and 3DS loaders.

If there are no objections, I will do the overwrite tomorrow.  I am starting on MD2Loader2 now.

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

Junior Devvie




Java games rock!


« Reply #43 - Posted 2005-08-24 01:00:58 »

What editor are you using for MD2 objects??
Offline croft

Junior Devvie




Java, Java, Java


« Reply #44 - Posted 2005-08-24 22:30:32 »

What editor are you using for MD2 objects??

I am not.  I am just using some MD2 files I have from before.  Why do you ask?

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

Junior Devvie




Java, Java, Java


« Reply #45 - Posted 2005-08-24 22:32:21 »

If there are no objections, I will do the overwrite tomorrow.  I am starting on MD2Loader2 now.

MD2Loader2 works.

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

Junior Devvie




Java games rock!


« Reply #46 - Posted 2005-08-24 23:42:32 »

Mainly because I want to start adding animations to my game and wondered if you used editor X version Y for compatibility assurance
Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #47 - Posted 2005-08-25 14:07:38 »

OBJLoader2 and MaterialLibLoader2 are now stable.  I was able to successfully test by using them in the Whoola 3D Browser.  Any comments or suggested changes to the code from those tracking?  If none, I will use the modified classes to overwrite the original OBJLoader and MaterialLibLoader sometime next week.  I will then move on to the MD2 and 3DS loaders.

If there are no objections, I will do the overwrite tomorrow.

Can you please hold off overwriting the old ones for a few days, I havn't had a chance to check it out yet.  Smiley

Thanks,

Will.

Offline croft

Junior Devvie




Java, Java, Java


« Reply #48 - Posted 2005-08-25 18:03:51 »

Can you please hold off overwriting the old ones for a few days, I havn't had a chance to check it out yet.  Smiley


OK, let me know when ready.

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

JGO Coder


Projects: 2


Fire at will


« Reply #49 - Posted 2005-08-31 06:02:55 »

croft,

I have had a chance to look at your changes.  They look great to me.  I think your enhancements are very useful.


I have a few non-functionality related issues which may sound petty but I feel are important for a community project such as this one:

1. When making changes to code such as this, it's better not to combine formatting changes with functionality changes, as the latter can get lost in the former (making it harder for someone evaluating to actually see what's changed).  I'm referring to changes like this:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
-        return new MD2RenderedFrame(frame.getName(),fanArray,stripArray,fanTexArray,stripTexArray,fanCounts,stripCounts);
+        return new MD2RenderedFrame(
+          frame.getName(),
+          fanArray,
+          stripArray,
+          fanTexArray,
+          stripTexArray,
+          fanCounts,
+          stripCounts);
     }


By all means make formatting changes that help readability as they do in this example, but please keep those changes to a seperate commit.

2.  Is there any reason the entire class is indented one level?  Because every line is changed, diff will show the entire file being removed and replaced.  While on my machine I can (and did) use the -w argument, the diff's generated by Collabnet (which can be handy) will be useless.

3  Is there any reason why you havn't followed the coding style of the original MD2Loader / xith3d project in general?  We don't put brackets on a new line, nor use the bulk slashes for comments.   To me, MD2Loader is more readable than MD2Loader2, but stylistic preferences aside, I think it is always best to stick to the one style for a project, and at least stick to the same style for a single package-tool.  If you were adding a stand-alone tool of your own creation, I wouldn't mind, but having two different styles used in the one package I think makes it harder to understand the package as a whole. 


To summarise:  I think the API changes are excellent, but the formatting changes not so.   Would it be possible to keep the code style as it is?

I really hope I havn't offended you, the last thing I want to do is push away someone who is making a valuable contribution to Xith3D as you are - but I feel I need to raise these issues.


Best Regards,

Will.

Offline croft

Junior Devvie




Java, Java, Java


« Reply #50 - Posted 2005-08-31 19:37:13 »

To summarise:  I think the API changes are excellent, but the formatting changes not so.   Would it be possible to keep the code style as it is?

Whenever I substantially revise a class written by someone else, I often reformat as I go so that it gradually becomes comprehensible to me.  I learned to program in the military which means using a format that is as readable as possible to ensure maintainability.  The style you see there is something that I evolved over 25 years.

I'm not willing to spend the time to revert the code style but I would have no objections if someone else did so, perhaps using an automated tool such as an IDE.

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

JGO Coder


Projects: 2


Fire at will


« Reply #51 - Posted 2005-09-01 00:47:43 »

Fair enough.  Do you agree with my comments though?

Comment #3 was made from a maintainability point of view as I think it is best to have one formatting style for one module.  Comment #1 I do feel is important because if someone is trying to isolate a regression bug by looking back though the commit logs and at changes, it's much easier when any stylistic changes are in their own commits (and therefore can simply be ignored by the bug hunter).

Like I said, I'm only referring to the modification of existing modules here.

Thanks again for the enhancements, if I find the time I will merge the changes and commit, until then it's perfectly usable as it is.

Cheers,

Will.

Offline croft

Junior Devvie




Java, Java, Java


« Reply #52 - Posted 2005-09-01 18:32:11 »

Fair enough.  Do you agree with my comments though?

I had looked at the Xith coding conventions earlier and had decided that Xith really did not have a standard at the moment:
http://xith.org/tiki-index.php?page=CodeConventions

I wrote a rigorous style guide myself a few years back:
http://www.croftpress.com/david/research/java/guide/

The most recent one that I wrote at a company, however, was much more lenient.  I pretty much just said read Chapter 7 in Java in a Nutshell and don't use tab characters.  I will nag novice junior Java programmers about some things but I don't put up a fuss if they ignore me.  I'm pretty much a believer in code ownership.

When I'm working with code that someone else wrote, I will keep the same style if the changes are minor and I'm not inheriting the code on a permanent basis.  If the changes are major such as an overhaul of most of a class or I am inheriting the code permanently, I will make the changes.

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

JGO Coder


Projects: 2


Fire at will


« Reply #53 - Posted 2005-09-02 02:49:20 »

Well it pretty much does:

Quote
Xith3D follows Sun's code conventions for Java with the following exceptions and refinements:

Only that the list of exceptions and refinements was never compiled.  One difference I know of is that four spaces are used for indenting.

Will.

 

Offline arne

Senior Devvie




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


« Reply #54 - Posted 2005-09-03 16:53:49 »

Hi
I've got this .obj File I tried to load. It contains Textures. By loading with the old OBJLoader I get the following Exception:
1  
2  
3  
4  
5  
6  
7  
8  
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
   at java.lang.String.substring(String.java:1768)
   at org.xith3d.loaders.obj.OBJLoader.load(OBJLoader.java:35)
   at org.xith3d.loaders.obj.OBJLoader.load(OBJLoader.java:31)
   at org.xith3d.loaders.obj.OBJLoader.load(OBJLoader.java:27)
   at core.GameObject.<init>(GameObject.java:72)
   at core.Map.<init>(Map.java:47)
   at core.Client.main(Client.java:171)

When loading with OBJLoader2 I get no Exception at all, but it simply returns null.

I think this is a really bad change, because without an Exception one wouldn't know it was the loader the caused the error. People might search themselfes to death (who would be assuming that the Loader doesn't work correctly, when it doesn't give a mesaage)
We could omit the Stack-Trace, but then we would at least have to make a message appear.

Arne

PS: I would of course happy if someone could help me out, why this error occurs.

PPS: No I haven't changed anything in the .obj file. It's exactly the one blender exported.

:: JOODE :: Xith3d :: OdeJava ::
Offline arne

Senior Devvie




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


« Reply #55 - Posted 2005-09-03 17:06:46 »

Ok now I've solved this issue (with help of the Stack-Trace Wink ), but now It still doesn't load correctly:
OBJLoader simply returns null.
But now OBJLoader2 gives me more information (and actually also loads the File, only there are no Textures applied). It prints me these Messages:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
org.xith3d.loaders.obj.MaterialLibLoader2:  ignoring unknown material tag:  "d 1.0"
org.xith3d.loaders.obj.MaterialLibLoader2:  ignoring unknown material tag:  "illum 2"
org.xith3d.loaders.obj.MaterialLibLoader2:  ignoring unknown material tag:  "d 1.0"
org.xith3d.loaders.obj.MaterialLibLoader2:  ignoring unknown material tag:  "illum 2"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.001_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.002_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.003_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.004_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.005_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.006_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.007_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.008_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.009_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.010_None"
org.xith3d.loaders.obj.OBJLoader2:  ignoring unknown OBJ tag:  "o Sphere.011_None"


At least it prints me these messages  Smiley Very good!!

Arne

:: JOODE :: Xith3d :: OdeJava ::
Offline Amos Wenger

Senior Devvie




Everything's possible, but not everything's fun...


« Reply #56 - Posted 2005-09-04 18:09:33 »

There's several OBJ Exporters scripts for Blender, and there's only one that's correct.
You can find it here http://blender3d.org/cms/Import___Export.5.0.html It's the "Wavefront OBJ Importer/Exporter".

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline croft

Junior Devvie




Java, Java, Java


« Reply #57 - Posted 2006-03-01 03:11:22 »

If there are no objections, I will do the overwrite tomorrow.  I am starting on MD2Loader2 now.

MD2Loader2 works.

I recompiled with the latest version of MD2Loader2 from arne and it crashed due to a minor bug.  I fixed the bug and the changes arne made look great.  Suddenly normals are working now!  Shouldn't arne add his @author tag to the MD2Loader2 javadoc?

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

Senior Devvie




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


« Reply #58 - Posted 2006-03-01 17:26:39 »

no - don't add me!
I only commited the code from 5parrowhawk. So add 5parrowhawk !

I just checked the cvs History (I thought I am going insane, because I didn't know that I've commited something like that)

:: JOODE :: Xith3d :: OdeJava ::
Offline croft

Junior Devvie




Java, Java, Java


« Reply #59 - Posted 2006-03-02 21:55:00 »

I only commited the code from 5parrowhawk. So add 5parrowhawk !

Does 5parrowhawk have commit access?

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Pages: 1 [2] 3
  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.

toopeicgaming1999 (38 views)
2014-11-26 15:22:04

toopeicgaming1999 (33 views)
2014-11-26 15:20:36

toopeicgaming1999 (8 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (25 views)
2014-11-25 11:26:43

Gibbo3771 (23 views)
2014-11-24 19:59:16

trollwarrior1 (36 views)
2014-11-22 12:13:56

xFryIx (75 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50
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!