jMonkeyEngine quick loading of 3D models

jMonkeyEngine Logo

Creating visualizations, games or other types of animation will meet with the need to load some kind of 3D models. It is no different in the case of an engine jMonkeyEngine, however, is a question as soon as possible to read such models? It is best to use the format provided by JME. Such a change of format will save a considerable amount of time needed to parse loaded models. Following is the code by which the model loaded in the format .obj, we now export to .dat:

URL model = Court.class.getClassLoader().getResource(
 Spatial courtNode = null;
 try {
 FormatConverter converter = new ObjToJme();
 converter.setProperty("mtllib", model);
 ByteArrayOutputStream BO = new ByteArrayOutputStream();
 converter.convert(model.openStream(), BO);
 courtNode = (Spatial)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO
 } catch (IOException e) { // Just in case anything happens
 logger.logp(Level.SEVERE, this.getClass().toString(),
 "simpleInitGame()", "Exception", e);

Memorized object we can now export:


Related prepared model:

courtNode = open("model/Court");
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • MySpace
  • PDF

Related Posts

  1. No comments yet.

  1. No trackbacks yet.



Zobacz sprawdzone|Zobacz} pozycjonowanie stron łódź na {|!}Interesują Ciebie tanie i niezawodne zamienniki tuszy / tuszów HP, czy oryginalny tusz HP w najlepszej cenie Tusze do HP DeskJet F350 Sklep Warszawa tania szybka dostawapłyty warstwowe płyty warstwowe płyty warstwowe