How do I use Blender models in Java?

前端 未结 4 1673
故里飘歌
故里飘歌 2021-02-04 05:13

Just a general question really?

Let\'s say I am making a game and have made a character model in Blender. How would I use this model in Java?

Would I import it s

相关标签:
4条回答
  • 2021-02-04 05:30

    There are input/output scripts available for Blender that will help you.

    Blend2Java, for example, is a set of Python scripts for use with Blender that will export to Java XML, which can be decoded with the standard java.beans.XMLDecoder class.

    There's a good overview of how to do this at http://blend2java.sourceforge.net/blend2java-howto.html

    0 讨论(0)
  • 2021-02-04 05:42

    Generally when making models in blender you export the model in a format which allows you to later import it in the game engine of your choice, which format you use differ in requirements.

    The export-import cycle is often referred to as the "Asset Pipeline", and you generally want to keep it as simple and automated as possible since it is something you or your artists will perform on a regular basis.

    So if we look at a few specific graphics engines and platforms;

    • OGRE3D (or Ogre4J) supports it's own plain-text format (.scene, .mesh.xml, .material.xml) in order to load scenes, models and materials. It also has support for armature animations among other things, there is also some support for loading .blend-files directly. See their documentation for blender.
    • JmonkeyEngine has support for loading both OGRE3D .scene's and .blend's directly. It also has it's own binary j3o format which these can be converted into when you want to package the game. For specific examples, see their tutorials.

    There are multiple formats you can take into consideration when deciding how you want to use your model. When it is imported however, the game engine of choice represents it in an internal structure which usually allows you to be decoupled from the exact format of choice.

    Picking which to use is and should not be written in stone since requirements might change and if done properly it should not have a considerable effect on the project. This is also something you should take into consideration if you are writing your own engine.

    0 讨论(0)
  • 2021-02-04 05:44

    Here's a better idea: Use an existing Java 3D library (dzzd I highly recommend) and load in your model using the library's built in functions. Then, instead of just working with the data, you can actually display it. From Blender, it's a simple matter of exporting as 3DS.

    0 讨论(0)
  • 2021-02-04 05:44

    Yet another solution: Java .Blend provides you with a type-safe Java API to all data in a Blender file. It supports even creating new Blender files from within Java ;)

    0 讨论(0)
提交回复
热议问题