I'm writing code for a Java project that displays X3D models and I'm using an XML parser to import the X3D files into the project. I've used some Subpanels to show where the X3D models would go when they're selected. The code that I have so far in the main class is:
The XML parser that I have so far is:
As you can see the XML parsers have a different layout as I used it to show a file called employees.xml and I haven't changed it round yet. The question that I'm asking is, how do I display the X3D models in the subpanels that I have in the main class at the top.
The problem, I suspect, is that, like me, most of us here don't know much about X3D except the first summary that google shows, nor what those 30 or so subpanels are meant to display.
You have not explained either, and you have not replied to the suggestions made in the previous post.
In general the logic is:
1. Read the file and create a set of model objects. This is called your application's domain model 2. Convert the information in the domain model - things like 3d coordinates, materials or whatever - into renderable graphics objects like points, lines, triangles or textures.
3. Modify the graphics objects according to environmental conditions like camera angle, perspective, lighting and nature of material.
4. Render these graphics objects, either using the GUI framework's methods or something more specialized towards graphics, like JOGL. In Swing, you would write code in
JPanel or JComponent's paintComponent(). JOGL can integrate into a Swing application, such that the windows and controls are provided by Swing but the drawing area is rendered by JOGL.
I'm quite sure there are existing x3d capable java frameworks that can help you with all 4 steps, so that you just have to write the user interface code. Knute has already suggested one; perhaps you should research on that.
I'll add this post to our Graphics forum too. Perhaps somebody who has subscribed to that forum will see it and give some helpful info.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop