Hi,
I ran into a very confusing and irritating problem. The deal is that
though my quite complicated 3D scene _alone_ runs just fine even on
NOT very powerful computers, it starts to crawl VERY slowly even on VERY powerful
computers as soon as i add any GUI component to the game. Below is what i'm
doing:
1) construct panel with some buttons and images
2) when user presses particular button, panel with Canvas3D is shown and 3D scene
is being constructed
3) user drives around the 3D scene (i have realtime 3D game)
Now, as it follows from the above, GUI, which is created in (1), is a
SEPARATE panel. First i tried to use CardLayout in order to construct
both Canvas3D and GUI panels first and after that simply switch
between them. This resulted in awful, enormous drop in the performance
of Java3D engine (from ~25fr/sec to ~1fr/sec). After that i decided to
manually switch between panels (by means of add/remove component
functions) - nothing changed. After removing GUI panel from the output
area (applet instance), i set all its components to null, called
removeNotify() function on it, .... - no effect.
At last this thing 'helped': i DID create GUI panel with all
components, but did NOT add the panel the output area - i just added
Canvas3D from the very beginning. And this resolved the problem - the
Java3D performance got back to normal. The only problem is that i
still can't get any input from user :).
The summary is:
- any GUI, even on a separate panel, is not 'compatible' with Java3D,
no matter how difficult GUI is or what components are used (either
Swing or AWT ones)
- it seems that the problem relates to 'visibility' of the components:
unless they are not shown, Java3D performance is OK, but once
they are on the screen, NOTHING, even destroying the peer, helps.
- difficult to say, but it looks like performance drop is not the fault of GC (at
least halts occur even when gc is inactive)
I can only wonder what causes this problems and if it can be overcome
somehow. I tried almost everything i could think of, but the problem
remains. If anyone here knows where the problem is or has ever came
across it, please, let me know. If anyone wrote something realtime
with GUI and met no performance drop, let me know as well.
Thanks a lot for any help or hint,
vladimir
>-----<===========>-----<
-=V=-
>-----<===========>-----<
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".