Terrain engine

Hi.

I’m currently porting a terrain engine from C++/DX to Java3D.
I’m trying using a SimpleUnivers and an array grid representing the ground. It runs fine (graphically) on Java, but it’s sluggish (11fps) compared with C++/DX (80fps). I know that the problem is in the code (not in Java3D!), in fact I’ve not yet translated the culling routines.

Now, I’ve not great experience with Java3D, so I’m not sure is possible to cull land “tiles” (group op polygons) using the SceneGraph.

In the DX version, I created a culling routine based on viewing frustum. This routine creates a list of visible polygons (every cicle) and then draws them on screen.

May I should simple use Immediate mode (as in PureImmediate demo), or there’s a way to mix Immediate mode with the SimpleUniverse?

Many Thanks

We just composed our terrain of tiles. Size is about 1/4 of the viewing distance. Each tile is a shape on its own attached to the terrain group.

Culling is done by Java3D as a common scenegraph service. No need to fool around with the viewing frustrum.

And no problem to achieve 80fps. (okok, depending on terrain resolution of course…) :slight_smile:

Great! ;D

But the only way is to split the map in tiles and attach every tile to the SceneGraph?

If I use only a “mesh” Java is unable to do culling for me, it is right?

Many thanks!

I think it’s possible.

The ROAM stuff from j3d.org e.g. need to do similar things. They analyze the terrain with respect to the frustrum and generate the shape to be rendered.

Terrain Rendering with Java3d has worked well, look:

http://www.frontiernet.net/~imaging/sc_terrain_dem.jpg

| View terrains with DEM Terrain Viewer,
|
| free source code is available.
|
| Uses Java3d, configured as an application, not a web applet.
|
http://www.frontiernet.net/~imaging/terrain_rendering.html

A Great Example from Germany ( with free source code ! )
features dynamic LOD, motion, and toggling from solid to mesh:

The vis.informatik.uni-stuttgart.de folks have an excellent demonstration
of Terrain Generation & Rendering with some of the best modern methods
( links below )

Web Demo with Free Source code

Real-Time Generation of Continuous Levels of Detail for Height Fields

| Features of the algorithm:
|
| * Continuous Level of Detail (i.e. dynamic mesh).
| * Top-Down approach.
| * Geomorphing.
| * Quadtree based (i.e. fast; easy view frustum culling).
|
| [ * also feature solid surface - wire mesh toggle ]
|
http://wwwvis.informatik.uni-stuttgart.de/javatevi/data/StudArbAus_MB.ps

Terrain Visualization with Java 3D ( Web Demo + Sourcecode )
---------------------------------- ~~~~~~~~~~~~~~~~~~~~~
http://wwwvis.informatik.uni-stuttgart.de/javatevi

http://wwwvis.informatik.uni-stuttgart.de/javatevi/Hawaii/index.html

http://wwwvis.informatik.uni-stuttgart.de/javatevi/data/TeVi.tgz

http://wwwvis.informatik.uni-stuttgart.de/eng/research/fields/current/chemvis/

The image is 12,1565 bytes.

I spared no expense in time or money to compress the image
to an optimimum level to achieve the perfect comprimise of
detail vs. image size ( and thus imposing unbearable download delays ).

– Paul, Java Developer & Web Animator

Imaging the Imagined: Modeling with & a Keyboard