views:

55

answers:

2

So I'm not 100% sure if it's possible, but what I'd like to do is take a model that someone has created for a game, say in Blender or something similar, in various formats, and from that create an image to show on a website.

Are there any Java libraries around that could help me with that? Java3D maybe? Or even something in Flash? Ideally you'd be able to rotate the model in some embedded flash app, but I'd settle for a plain old image.

+1  A: 

Take a look into this post: http://techblog.floorplanner.com/2010/01/25/introducing-asblender/

"Enter ASBlender, a library I slapped together in a few days to read Blender’s .blend file format and parse it to AS3."

lucky you! ;)

EDIT: added link for the project: http://github.com/timknip/asblender

EDIT2: With the asblender library you can parse directly the .blend file (this is the working file, not a exported file format). Once you have the file inside the flash application you can use Papervision (I believe you do the same with other 3d libraries) to render the model, this way you can do a single image of the model or you can let user to see the model rotating. Beware that any of this libraries won't give the same render quality that a 3D application like blender is capable of. The good thing about this library is the capability of reading all the info in the scene, so you can match cameras and lights to be as close as possible to the original .blend file. Alternatively there are also other parsers like Ase, Collada , DAE, KMZ, Max3DS, MD2, Sketchup, SketchupCollada... all of this inside papervision library.

dome
+1  A: 

It depends on how far you want to go. Most models are going to be in a standard format- or can easily be converted to be - and most 3D Apis are able to load these formats in.

It would be a little unusual to do this on a server - you may even need to have OpenGL installed on it - but it should be quite easy to load a model in to a 3D environment and take a snapshot or a series of snapshots quite easily. Possibly even use these to create a short video clip of a complete turn around the model. If you're using Java take a look at some of the things people are working on over at http://www.javagaming.org/ - I don't know that Java3D is in use much still but there are other good 3D java environments around. JMonkeyEngine looked most interesting last time I was exploring that area.

Alternatively you probably can set up a way of loading the model into a clientside environment - I don't know if Flash can do 3D stuff now, but Shockwave certainly can ( although it's horrible to work with ) and I believe the Silverlight stuff likewise. Of course unless you are pregenerating your animations you are likely to be passing the model to your display logic on the client and a savvy user could intercept that, but the risk is probably reasonably low and from your question it's not clear whether that would be a problem to you.

glenatron