Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (711)
Games in Android Showcase (213)
games submitted by our members
Games in WIP (785)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java3D in a Swing Application..  (Read 2257 times)
0 Members and 1 Guest are viewing this topic.
Offline ArchangelMorph

Senior Newbie

Java games rock!

« Posted 2005-03-18 13:34:53 »

I want to create a Swing application to display two 3D models in viewports similar to the kind you'd see in programs like 3D modellers..

I'm ok with my current understand of Swing and seperately with Java 3D (in creating applets) but i've never had any experience in bringing the two together and I've read around the net and it seems like its an area where people seem to have alot of problems..

The question i'd like to raise is what component do I use to display my Java3D model scene in an application frame? would I embedd a canvas3D object into a container like a panel or would that be impossible/too slow?

Or would I have to (or would it be easier to..) create a pop-up window or even a pop-up applet to display my Java3D scene?

And lastly is the use of Swing even reccomended in this or should I revert back to using awt for compatibility?

hope someone can help?

- ArchangelMorph -
Offline Herkules

Senior Devvie

Friendly fire isn't friendly!

« Reply #1 - Posted 2005-03-18 13:50:18 »

FlyingGuns actually is a Swing app with Java3D included.

Just avoid Java3D in JInternalFrames, JSplitPane caused some problems as well (maybe they have been sorted out with latest Java3D releases).

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline bmyers

Junior Devvie

« Reply #2 - Posted 2005-03-29 14:33:33 »

You can put a Canvas3D inside a JPanel, but you will want to organize your layout up-front to make sure the Canvas3D doesn't overlap with any other Swing component, because the Canvas3D (heavyweight) will eclipse the lightweight component.  I have used a Canvas3D inside a TabPane with no problem, as long as I detach any live BranchGroups when switching tabs (however this causes a delay depending on the size of your BranchGroup).

You can also use two Canvas3Ds, perhaps side-by-side in different JPanels.  Your performance will degrade, however, because you'll be splitting CPU between the two Canvas3D's.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline arne

Senior Devvie

money is the worst drug- we should not let it rule

« Reply #3 - Posted 2005-03-29 15:15:31 »

If you want to draw any swing stuff above the Canvas3D you can use a Panel (yes a Panel not a JPanel) and add the swing stuff to the Panel. This way the heavyweight Panel draws above the canvas, but doesn't draw above the Swing Wink

:: JOODE :: Xith3d :: OdeJava ::
Offline bmyers

Junior Devvie

« Reply #4 - Posted 2005-03-29 17:55:04 »

Sure, that'd work too, I think, though I haven't tried it myself.

That's basically the way a JFrame or JDialog works, since they both have heavyweight native peers (IIRC).

Offline ArchangelMorph

Senior Newbie

Java games rock!

« Reply #5 - Posted 2005-03-29 18:19:47 »

Sounds awesome i think i'll do that..

Although u've raised a concern for me.. In my program I intend to use at most two canvas3D's in the application..

They will only be displaying animations of single 3D models (built entirely using primitives) walking seperately..

So I'm curious,
Do you think the performance will degrade terribly when both canvas's are active?

- ArchangelMorph -
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

numerical (296 views)
2017-02-21 07:32:16

numerical (295 views)
2017-02-21 07:31:46

theagentd (406 views)
2017-02-18 13:42:33

theagentd (404 views)
2017-02-18 13:35:16

h.pernpeintner (1572 views)
2017-01-24 22:39:11

h.pernpeintner (1559 views)
2017-01-24 22:38:32

Galdo (2123 views)
2017-01-12 13:44:09

Archive (2112 views)
2017-01-02 05:31:41

0AndrewShepherd0 (2647 views)
2016-12-16 03:58:39

0AndrewShepherd0 (2351 views)
2016-12-15 21:50:57
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!