How can I eliminate *lag* from Java3D applets

Hi all.

Currently Im working on walk-in-a-maze applet using Java3D library. (Please imagine First Person Shooting game without shooting :stuck_out_tongue: Thats what my applet is all about)

The problem I have with my code ( or with Java3D?) is that my applet lags once in 3-5 sec.
The applet runs@70+FPS, and Im satisfied with that result, but it looks like running @15FPS or fewer because of the lag.

I tried everything I can come up with; eliminating creation of new objects with in every methods called up per frame, reducing the number of Shape3D I use, I even removed all textures away.
For all the thing Ive done, Im yet to find any improvement.

Is this the normal case in Java3D, or is there anyway to get rid of those annoying lags?

Thank you, experts, in advance.

Slef solved :frowning:

Sorry 4 posting stupid question guys, Id been working on this problem for 3 days for now when I posted this message, and I thought that Id done every try possible.

I found my wave sound system and FPS rate display system was causing the lag

Well Ill go work on them :x

yea… displaying the framerate can produce tons of garbage. even if your machine is capable to display 800 frames a second and u lock em down to 75 or 85… it will still stutter every 4-5 seconds.

“fps:”+fps = a lot of junk per second :>

[quote]“fps:”+fps = a lot of junk per second :>
[/quote]
This will be barely noticable. But creating and setting a new texture each frame like Text2D does - that hurts.

Addintionally, running at ‘full speed’ (e.g. with WakeupOnElapsedFrames(0)) may cause some stutter. Dunno wether you did…
Depending on the game everything above 60FPS is a waste of CPU.

oNyx and Herkules, thank you guys for kind reply.

[quote]But creating and setting a new texture each frame like Text2D does - that hurts.
[/quote]
That is what I was doing.

[quote]Addintionally, running at ‘full speed’ (e.g. with WakeupOnElapsedFrames(0)) may cause some stutter.
[/quote]
I didnt know that, thankl you for the information. Ill try your advice.

best regars, Koji