jPCT - a 3d engine for Java > Support

landscape viewer applet

(1/3) > >>

danmeany:
I am thinking about cobbling together an interactive applet viewer for some large dataset public domain elevation data from the USGS (for the curious it's in ".BIL" format - an integer raster).  Basically I am just grabbing sections out of the file and moving around in the canyons etc and viewing it from different angles, like a virtual hiker, maybe overlaying some satellite vegetation coverage data if i get carried away.  Do you think jPCT would be a good choice for that, and/or do you forsee any pitfalls?  Or has someone already solved this problem...:)

EgonOlsen:
Do you just want to grab some parts of the file and display only those, or do you want to stream the file from the server while the camera moves? Anyway, it should be possible with jPCT but the later case will require some streaming on a per object/block base and it may limit octree usage. Or in other words: It's not an easy thing to do, i think.
The former case is much easier. Load your data using with your own loader, maybe setup an octree for it, place the camera and some lights and you should be done (well...almost... :wink: ). A VERY basic example of a landscape can be found in the example-dir that comes with jPCT.
Keep in mind that you are limited to the software renderer when using jPCT in an applet. This is due to the design of LWJGL (the OpenGL binding jPCT uses) and the applet's sandbox.

danmeany:
thanks for the helpful reply.  i am not going to stream.  they'll just have to wait while the applet downloads with the 40M of data inside the zip, then it will be fast after that while they are using it, or so i tell myself :)  And the software renderer is no prob.  The terrain demo runs at 7 fps on my old 200mhz laptop, which is fine for this purpose.  So i guess it will work with the MS VM and Sun plugin, blah blah?  do you know if not using BufferedImage in 1.1 hurts performance terribly?  and do you cull stuff in the line of sight but far away?  if so i will make the background mist colored and it will be fine otherwise i might have a prob since there is alot of terrain in any direction.

EgonOlsen:
Using a MemoryImageSource in 1.1 instead of the BufferedImage is not that much of a performance problem, so don't worry about it.
jPCT clips (the software renderer culls to be exact) on the far clipping plane (can be set in Config). There is done some gross culling on a per object and per octree-node base, so if you decide to use octrees, the culling will be very fast on that plane, even if large portions of the landscape are not visible. If you want to fade out the landscape into another color than black, you need version 0.95 (to be released...) to make that effect look good.

danmeany:
Sweet.  And one last thing - if World and it's all it's potential children are java.io.Serializable, then I can pre-compute it and save it off to be able to quickly reload it later....

Navigation

[0] Message Index

[#] Next page

Go to full version