Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
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  
  AC3D Loader  (Read 3015 times)
0 Members and 1 Guest are viewing this topic.
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Posted 2003-11-04 21:31:14 »

Hi
 I've 'finished' porting my ac3d loader over to xith, when I say finished, I mean i fixed the two bugs. There is still one peice of it I don't like, when loading textures I couldn't work out the format, so I load it as a buffered image (real one using ImageIO), then it fails if I pass that into loadTexture in texture loader, so I pass in the filename and load it again. This way I know if it has alpha chanel or not, and can use the right format. This means I can do transparent textures on my ac3d models, which is nice Smiley

So check it out, if you happen to have any ac3d models Smiley

New Dawn Software, under resources and Xith3D loaders

Cheers

Endolf

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #1 - Posted 2003-11-05 01:56:33 »

I don't have any AC3D models but if I read you correctly there is a limitation of the Xith3D TextureLoader which should be fixed?

I recall having transparency (partially) working with the ASE loader, the texture was transparent but there were one or two other problems which may have been my fault not xith's.

Will.

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #2 - Posted 2003-11-05 05:49:03 »

Hi
 The limitation as I see it is 2 fold, first, if you use the loadTexture method with a filename, when I tried to get the image format I got a format of 0, for every texture I tried, alpha chanel present or not. Then the other problem is that when I load a texture as a buffered image of my own, it throws an exception when I try to use said buffered image in the loadTexture method. I'll posts some stack trace at some point, think it will be friday before I get to code again outside of work.

Endolf


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #3 - Posted 2003-11-05 06:23:57 »

Please post stack traces either here or in Issuezilla. I am very interested in this test case at least because of loading textures from buffered images work for me perfectly (both RGB and RGBA).

Yuri

Yuri Vl. Gushchin
JProof Group
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #4 - Posted 2003-11-05 06:40:59 »

Quote
the other problem is that when I load a texture as a buffered image of my own, it throws an exception when I try to use said buffered image in the loadTexture method.


As I recall, I also had similar problem until I wrapped BufferedImage into DirectBufferedImage.

To load textures, I use something like

1  
2  
3  
4  
5  
6  
7  
8  
9  
BufferedImage bi;
...
String s = null;
if (bi.getColorModel().hasAlpha())
  s = "RGBA";
else
  s = "RGB";

texture = TextureLoader.getInstance().constructTexture(DirectBufferedImage.make(bi), s, mipmap, magFilter, minFilter, Texture.WRAP, false, TextureLoader.SCALE_DRAW_BEST);


This works fine with both RGB and RGBA textures.

Yuri

Yuri Vl. Gushchin
JProof Group
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #5 - Posted 2003-11-05 07:14:10 »

Hi
 Thanks, i'll give it a go when I get a chance, should be friday.

Cheers

Endolf

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #6 - Posted 2003-11-06 17:36:37 »

Hi
 Using DirectBufferedImage.make fixed it, image is only loaded once now. New version uploaded

Cheers

Endolf

Edit: I've added a link to the loader from the xith-tk website, under file sharing

Offline William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #7 - Posted 2003-11-06 23:38:07 »

Cool, four loaders in the toolkit now and growing Smiley

Do you plan on adding the code into CVS as well?

Will.


Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #8 - Posted 2003-11-07 07:06:24 »

Hi
 I admit that I hadn't planned too. The source is in the download zip. There are 3 parts to my loader, a general parser/loader that loads the ac3d model into an internal format, and then there are 2 renderers, one for java3d and one for xith. I didn't want to check just some bits in, but likewise didn't want to check in the java3d renderer into a xith3d project. Currently there are two seperate downloads, so you only get the bits you need/want, but the source is in one place (different ant targets to generate the downloads).

Endolf

Offline Preston

Senior Member


Medals: 4



« Reply #9 - Posted 2003-11-18 12:10:13 »

Quote

As I recall, I also had similar problem until I wrapped BufferedImage into DirectBufferedImage.

To load textures, I use something like

1  
2  
3  
4  
5  
6  
7  
8  
9  
BufferedImage bi;
...
String s = null;
if (bi.getColorModel().hasAlpha())
  s = "RGBA";
else
  s = "RGB";

texture = TextureLoader.getInstance().constructTexture(DirectBufferedImage.make(bi), s, mipmap, magFilter, minFilter, Texture.WRAP, false, TextureLoader.SCALE_DRAW_BEST);

This works fine with both RGB and RGBA textures.

Thanks, this way to create an RGBA texture works fine for me, too.

Would it be possible to use Xith3d's texture cache even when using textureLoader.constructTexture(..) ? (Usually the cache is being used when I call loadTexture and getTexture.)

The RGBA BufferedImage I construct from a RGB-Png file plus an Alpha-Png file, and feed the RGBA BufferedImage to your mentioned constructTexture(..). While this works fine, is this maybe too fussily? Maybe there is a simpler way in Xith3d to achieve this which I don't know?

Just a question, no call for "more features" in Xith3d this time. :-)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #10 - Posted 2003-11-18 12:34:00 »

Quote
Just a question, no call for "more features" in Xith3d this time. :-)

If that was aimed at me, no Smiley, I'm still waiting for concave polygon triangulation and smooth normal generation Smiley

Endolf.

Offline Preston

Senior Member


Medals: 4



« Reply #11 - Posted 2003-11-18 13:05:10 »

Quote

If that was aimed at me, no :), I'm still waiting for concave polygon triangulation and smooth normal generation :)

Well, for the "smooth normal generation" (comparable to com.sun.j3d.utils.geometry.NormalGenerator maybe?) I say +1. :-)
Offline shochu

Junior Member




Java games rock!


« Reply #12 - Posted 2003-11-20 11:29:06 »

Do any of these loaders support animation?
Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #13 - Posted 2003-11-20 11:39:17 »

AFAIK:

MD3 Loader - Supports Animation, but not sure where this is available at the moment.

AC3D - File format and tool don't support animation and hence the loader doesn't

OBJ - File format doesn't support animation and hence the loader doesn't.

ASE - File format doesn't support animation? (not sure about this one actually)

MD2 - Animation is supported but only the frames set  out in the file.

3DS - Jointed animation is supported, Morped is not. Although, I suppose this could be added now Morph works Smiley

Kev

Offline shochu

Junior Member




Java games rock!


« Reply #14 - Posted 2003-11-20 14:07:33 »

3ds seems like the way to go.  Do you know anyways to convert files into 3ds?  I'm using milkshape3d right now.
Offline kevglass

JGO Kernel


Medals: 122
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #15 - Posted 2003-11-20 14:28:55 »

If you're using MS3D the best thing to do I would think is to write a MS3D loader Smiley There seems to be a wealth of information about this and a couple of reference Java3D implementations to use.

Every conversion tool I've seen from 3D model format to 3D model format strips out animation..

I believe you can export to 3DS from Milkshape tho? Ahh.. checked web site, export is to ASC.

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.

CogWheelz (16 views)
2014-07-30 21:08:39

Riven (22 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!