jPCT for an engineering type app?

Started by xander, April 13, 2004, 07:03:04 AM

Previous topic - Next topic

xander

I'm searching for a suitable Java 3D engine to use in an engineering configuration application where the user configures 2D and 3D objects (e.g. flat piece of glass, a glass shower enclosure, a bookcase, table, etc). The configuration takes place through some graphical interaction where the user might select an object and set the properties (e.g. height, width, etc) of the selected object or even select an object edge and add a notch or even a hole (e.g. for flat glass).

The reason I'm currently going after a 3D engine (rather than a CAD-type engine with CAD-type GUI) is that the users of our application would be more sales orientated than engineering orientated and a real CAD interface would be to overwhelming. I would basically have "intelligent objects" in the background (the model) and have views generated for the 3D interaction. I would also prefer the better real time rendering of something like jPCT over your typical CAD engine.

Some basic questions if I may:
1. I assume I can render the image inside a JPanel (or similar) to allow JButtons, etc next to the scene? Lightweight or Heavyweight?
2. How do I render a simple 5-sided polygon with a hole somewhere where the polygon, sides and hole are selecteble? Maybe publishing of some of the sample primitives will answer this question?
3. Since I probably need to draw selectable 3D Lines and Points, I imagine I can use the Sphere primitive for the points but what about the Lines? Maybe use a very thin Cylinder?
4. I will most likely have 3 simultaneous views on the same model. Does jPCT support multiple simultaneous cameras?

I'm trying to establish whether jPCT will work for my application or whether there is anything else that would be better. I did look at Java 3D as well but prefer jPCT for it's simplicity. Any ideas an feedback appreciated.

TIA

[edit]From another post in the forum I gather that, wrt q1 above, I will only be able to achieve this using software mode for now. That is probably ok...[/edit]

EgonOlsen

Quote
1. I assume I can render the image inside a JPanel (or similar) to allow JButtons, etc next to the scene? Lightweight or Heavyweight?

As you've already mentioned, this is possible with the software renderer. jPCT will render into an Image, so whatever can be done with an Image can be done with the rendered output (getOutputBuffer() in FrameBuffer will help you here). You may try to use OpenGL instead of software and get the rendered output in the same way, but that's most likely very slow and you'll still have an OpenGL-window lying around on your desktop...so that sounds like a bad idea.

Quote
2. How do I render a simple 5-sided polygon with a hole somewhere where the polygon, sides and hole are selecteble? Maybe publishing of some of the sample primitives will answer this question?

You have to model the 5-sided polygon with the hole by using triangles. Either by finding an algorithm that can do it or by using some 3d editor. Picking the polygons is easy, picking the sides...no idea at the moment but should be achievable somehow. Picking the hole is currently impossible, because you can't pick "nothing". A workaround would be to build the hole out of transparent polygons and pick that object instead.

Quote
3. Since I probably need to draw selectable 3D Lines and Points, I imagine I can use the Sphere primitive for the points but what about the Lines? Maybe use a very thin Cylinder?

You can easily build some primitives for that yourself. A cylinder should work too, but may be polygonal overkill.

Quote
4. I will most likely have 3 simultaneous views on the same model. Does jPCT support multiple simultaneous cameras?

Yes, you can do that. Either by modifying the camera itself for each view or by creating yourself 3 cameras and replace the camera in World with the right one for each view. PrimordialSoup did that. You can see the results in this thread: http://www.jpct.net/forum/viewtopic.php?t=15

Hope this helps.

xander

Thanks, and yes it does help. I think a 3D wire frame line (non-polygonal) would be a nice addition to the standard library primitives. It would be nice in fact to do all of the following: line, arc, circle, ellipse, polyline.

EgonOlsen

Quote from: "xander"It would be nice in fact to do all of the following: line, arc, circle, ellipse, polyline.
I agree that this would be a helpfull addition in some situations, but it's not jPCT's main goal to offer such things. If you really need it, you can either use the Java2D-stuff on top of a software rendered image (works for Java2 only, because a MemoryImageSource doesn't provide you with a usable Graphics-instance) or render the lines and circles in an int[]-array and blit that into the rendered image (works with OpenGL too).