Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
479 views
in Technique[技术] by (71.8m points)

file format - Recommended 3D model type for in-game character model, loaded manually?

I'm writing a game in JOGL and need to represent the in-game character. I plan to use skeletal animation for the character movements, and of course the character will be skinned. I can't seem to find any good model loaders for JOGL so I plan to load the filetype myself, based on specs or something. I also plan to use Blender as my 3D modeler, so some type that exists in there would be best.

What filetype do you recommend I use? .blend? .x, .3ds, .md2/3/5, ...?? Remember I'd like something with a clear defined format so that I can write the loader without having to deobfuscate some random file format, and it needs to support the aforementioned features. Any other info you can give regarding why you chose it and why it's best would be very helpeful too!

Thanks!

EDIT: I will be writing a Blender MS3D exporter. When I'm finished I will post it here.

Meanwhile, see my marked answer below; but more has gone on since then. I'm not going to keep this updated with what I'm doing, but basically I found jMonkey Engine and it already has a ms3d importer and other subsystems which I had begun hand-writing. Despite the scenegraph stuff (which is why I was avoiding Java3D) I think it'll be my best bet to join forces with it, so that's what I'm up to.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If you can live with just geometry, or are prepared to handle your own texturing, then .obj is probably the most straightforward and widely supported 3D file format. It's basically the ascii of 3D modelling.

Otherwise I'd tend towards vrml. It's well defined and there is at least some code around to get you started. I've successfully loaded vrml models into java3D using freely available code. Native file size tends to be large, but that can be solved by using a compressed format.

I would not recommend .3ds. The only time I've handled a reader for this format was in Delphi Pascal, and it's messy, ill-defined, difficult to process and tends to have lots of 'variations' such that although I managed to get my reader handling models exported from 3D-MAX itself just fine it rejected many models from other packages that claimed to be in 3DS format but were not properly formed.

ADDED: Also I'd recommend you take a look at the Java3D API and the O'Reilly book Killer Game Programming in Java as even if you don't go down the Java3D route it is likely to answer a lot of your questions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...