Programming => LWJGL Documentation => Topic started by: CaseyB on July 19, 2005, 20:18:24

Title: XMLLoader
Post by: CaseyB on July 19, 2005, 20:18:24
Is there a tutorial out there that shows how to use the XMLLoader?  I have been trying to figure it out, but really I'm just making stabs in the dark!  Any help would be greatly appreciated!
Title: Hmmm
Post by: CaseyB on July 20, 2005, 14:40:45
Ok, here is what i am trying:
Code: [Select]
   // Load in the XML File
   File XMLFile = new File("MeshedModelSample.xml");

   // Convert the XML into a Document
   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
   DocumentBuilder builder = factory.newDocumentBuilder();
   Document doc = builder.parse(XMLFile);

   // Load the Document into the XMLLoader
   XMLLoader loader = new XMLLoader(doc);
   // Get Model from XMLLoader
   model = (MeshedModel) loader.load();
   // Set the model into the ModelRenderer
catch (ParserConfigurationException e)
   System.err.println("Parser Error: " + e);
catch (SAXException e)
   System.err.println("SAX Error: " + e);
catch (IOException e)
   System.err.println("IO Error: " + e);
catch (Exception e)
   System.err.println("Loader Error: " + e);

I think this is loading the model correctly (well, at least it isn't throwing an exception) but then How do I draw it?  Here is my render method:
Code: [Select]

It doesn't show anything!  What am I doing wrong?[/code]
Title: XMLLoader
Post by: Matzon on July 20, 2005, 15:13:38
/me patiently waits for Cas to explain the code :roll:
Title: FrameProcessor
Post by: CaseyB on July 20, 2005, 15:13:57
Looking throught the JavaDocs, it looks like I need a FrameProcessor, but it's not a concrete class and I can't seem to find anything that returns a FrameProcessor... I'll keep looking!

I added some comments to the code above to better explain what I am trying to do!