Win a copy of Raising Young Coders: A Parent’s Guide to Teaching Programming at Home this week in the General Computing forum!
Forums Login/signup

Displaying an X3D image within a subpanel

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.

reply
reply
This thread has been viewed 4042 times.
Similar Threads
Adding a new page to my contaier.
Why is this code taking too long to launch
coding a texteditor: want to open a separate option window
How come this isn't working anymore?
HeadFirst >>Chapter14:ArrayList Error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Jun 27, 2025 08:55:31.