Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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 1486 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 Duke




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 Duke





« 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 Duke




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 Duke





« 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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (31 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!