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

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

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.

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.

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!

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

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.

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.

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:

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.

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.

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.

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.

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.

Ok now I've solved this issue (with help of the Stack-Trace ), 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:

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?

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