Hi Folks,
Love the work done here. Thanks so much for being willing to share. Let me first say that I am NOT trying to create a game. (not yet at least). This is all for learning the ins and outs for me. I am a 14 year programming vet, but this is my first foray into graphics. So, theres the background on my newness.
Anyway, I am trying to load a model and the format is .obj, exported from blender. My failure happens here
converter.convert(modele.openStream(), BO);
So, my files are found correctly, but I get that java.lang.NullPointerException. I have searched and played around for days, but to no avail. Hence, my first question! I would appreciate it anyone could tell me whats wrong. I am using the flagrush tutorial as my basis for this learning tool.
Spatial st = null;
URL modele=Lesson8.class.getClassLoader().getResource("jmetest/rtsdemo/data/runman.obj");
// Create something to convert .obj format to .jme
FormatConverter converter=new ObjToJme();
// Point the converter to where it will find the .mtl file from
converter.setProperty("mtllib",modele);
// This byte array will hold my .jme file
ByteArrayOutputStream BO=new ByteArrayOutputStream();
try
{
// Use the format converter to convert .obj to .jme
converter.convert(modele.openStream(), BO);
st=(Spatial)BinaryImporter.getInstance().load(new ByteArrayInputStream(BO.toByteArray()));
// shrink this baby down some
st.setLocalScale(.1f);
st.setModelBound(new BoundingBox());
st.updateModelBound();
} catch (IOException e)
{ // Just in case anything happens
System.exit(0);
}
st.setLocalScale(1.0f);
Thanks for any help that can be offered.
showtime