Online 3D file viewing?

TheBitterEnd

Well-known member
Alright, here ya' go - this is Little Neath River Cave (as read from http://www.ubss.org.uk/resources/surveys/survex/LNRC.lox). You will need  the Java runtime installed (http://www.java.com) and you will need to accept my self signed certificate.

http://chris-h.me.uk/loch/LochViewer.html

As you will see I have only done centre-line data, if there is any real interest I may well be persuaded to do the surfaces & images etc. I'll post the source when I get it tidied up a bit.

Putting something like this in your webpage gets you a view of your Loch file specified by the VALUE parameter

Code:
<APPLET CODE="plumbing.swing.d3.Applet3d" WIDTH="800" HEIGHT="800" archive="loch.jar" 
codebase='http://chris-h.me.uk/loch/'>
    <PARAM NAME="lochUrl"    VALUE="http://www.ubss.org.uk/resources/surveys/survex/LNRC.lox">
</APPLET>
 

Duncan Price

Active member
Excellent!  :clap:

I'd like to use this to provide an easy way for visitors to my website to view surveys without having to have the SURVEX or Loch viewers installed locally.  Currently I upload a .jpeg plan of the state-of-play:

fairy_cave_quarry.jpg


for those interested.  But it would be much better if it could be done better - particularly as I'm about to move to a nested storage of the raw data for the purposes of better organisation (you'd need to download a .zip archive and recompile).  I'd rather visitors have an easy way of exploring the survey without too much pain.

3d support with passage walls and surface overlay would be a bonus.

Duncan
 

graham

New member
sirch2

This is brilliant!

Is it possible to give it the same functionality as the lox viewer, as in what can be turned on and off from the view as well as the ability to move it about?

And doubtless Duncan will say he wants a "Survex Aven" version as well though I can convert his survex 3d file to Therion very quickly.
 

TheBitterEnd

Well-known member
Bugger! Having got that off my chest I was rather hoping it would sit in a corner and die quietly. All of a sudden some of those digs down Notts2 are looking quite attractive ;) (Loch scraps and surfaces could be a bit of a fight!)

Seriously though, thanks for the encouraging feedback.

Before I get too locked into the Applet thing I want to try out some alternative methods of presentation, so to that end I thought I'd look at SVG and after a limited trial the results are pretty unusable for real time 3D (SVG is pretty good for vector graphics on the web but not for 3d calcs). Here is the same Little Neath as SVG (it could be mouse controlled like the applet but because it is so slow I left the sliders in).
http://chris-h.me.uk/loch/LNRC.svg
It works but it is really slow. Here is a cut down version with just the first 100 survey legs which is just about usable
http://chris-h.me.uk/loch/LNRC-part.svg

I think next I might have a go at a flash version. As I understand it flash does some sort of compile to byte-code a bit like Java so may run faster than the javascript in the SVG.

Graham - it will probably be possible to turn things on and off, what attributes do you want to base visibility on?

As for reading other file formats, assuming the format is known, it's then just a matter of doing the leg work.
 

Duncan Price

Active member
graham said:
And doubtless Duncan will say he wants a "Survex Aven" version as well though I can convert his survex 3d file to Therion very quickly.

I'm sure you can - but I'm thinking along the lines of doing a better conversion.
 

graham

New member
Duncan Price said:
graham said:
And doubtless Duncan will say he wants a "Survex Aven" version as well though I can convert his survex 3d file to Therion very quickly.

I'm sure you can - but I'm thinking along the lines of doing a better conversion.

Good man.  (y)
 

TheBitterEnd

Well-known member
Thses things are just like buses, none for ages and then a load come along at once.

Try this one. It's a flash based example (ignore the big status box at the bottom, that will be going). I have tried it with a couple of versions of flash and with the latest version it seems fine, on an older version it is unusably slow. Let me know if it is usable for you.

http://chris-h.me.uk/loch/flashExample.html

There are pros and cons of flash versus the Java applet and I am open to input from you guys about which way to jump.

The Java Applet can read lox files directly, Java applets have been around since the mid nineties and Java is a very well established platform that runs on a wide range of systems. The draw back is that users have to install a large plug-in, which most people don't have.

The flash version will not be able to read the lox file directly - some kind of conversion will be needed. Flash has been around for nearly as long as Java but has been through 3 owners. It does have a massive installed base for the plug-in. Nearly everyone has it.
 

Duncan Price

Active member
I'm happy with the Java version - I need Java to run other stuff and it is not unreasonable to advise viewers of this.  There is no (?) Flash for 64 bit IE so I'm forced to run the 32 bit browser on Win7 Home Premium.

When I get my $h1t together I'll put up .lox versions on my survey data - at the moment I rely on readers to have the 1.1.15 version of Survex which is not supported by the Loch viewer.

Duncan
 

Bob G

New member
Slightly oblique to the topic, but is there any support for generating stereoscopic images of the surveys?
This has become an interesting proposition with the increasing availability of large 3d TVs and 3d-capable PC monitors.
As I understand it, rendering 3d coordinate data to a stereo image is not as difficult as one might think, but I imagine real-time re-rendering after multi-axis rotation may well be beyond the average PC.
 

graham

New member
Bob G

Both Therion ans Survex will generate stereoscopic images, but as I lost my 3d glasses ages ago, I don't use them often enough to say how well they work.
 

TheBitterEnd

Well-known member
Bob G said:
...
but I imagine real-time re-rendering after multi-axis rotation may well be beyond the average PC.

I would have thought, for cave surveys, your average PC was up to it, after all it's only calculating a second set of points displaced from the first by some factor proportional to z-axis position. We are not trying to render light and shade or leaves blowing in the wind.

That said, what would 3D add to our understanding of the relationship of cave passages? I personally think 3D is an over-hyped gimmick that is really there to help protect copyright (and rip off the gullible) so I doubt that I'll be implementing it. But the source will be available so someone else might.

 

footleg

New member
For me the flash based viewer works the best. I had to disable lots of security and use Internet Explorer for the Java based one as it appears it also uses an ActiveX control. But the flash based one works great in Firefox (on 64 bit Windows 7).

As for 3D stereo views. The Loch viewer in Therion has a red-green anaglyph mode which works really well with the appropriate red-green glasses and really helps to see what it what on complex cave systems.
 

wookey

Active member
Here is another interesting development that Julian Todd alerted me to recently:
VML is a standard for online graphics which is better designed than VRML, and thus may achieve wider usage.
Here is a library using it, which has some cool demos: http://raphaeljs.com/

And here are Julian's demos using tunnel which show how easy it is to have real online surveys in a standards-compliant manner without evil proprietary flash, or OS-specific stuff like silverlight:

To quote Julian:
Very first experiment here:                                                                                               
    http://scraperwiki.com/views/cave-svg-viewer/full/                                                                     
                                                                                                                           
And this shows the tiny amount of code needed to do that:                                                                   
    http://scraperwiki.com/views/cave-svg-viewer/edit/

This looks like a very promising area for activity to me. If anyone fancies working on this stuff I'm sure that would be a very productive.
 

TheBitterEnd

Well-known member
Bob G - apologies if I came on a little strong earlier, nothing wrong with your Stereo suggestion. It's just that paying an extra ?3 per child to watch an out of focus film and finish up with a head ache in the name of "a better motion picture experience" gets right up my nose.
 

TheBitterEnd

Well-known member
Footleg, the Java version works fine for me in Firefox 3.6.13 - like you said it is probably a security setting somewhere. And of course flash is an ActiveX control...

BTW. the majority seem to be liking the Java better than Flash. The thing with Flash is that I doubt that it will read Loch files directly, so it will either mean having to convert the .lox to something like XML either manually and store as yet another file on the server, or via a server-side component that does the conversion on the fly. That said I was quite chuffed with the Flash version, so I'm not necessarily ruling out maintaining both but obviously it is up to those hosting the surveys to choose what they implement.
 

TheBitterEnd

Well-known member
Wookey - behind all that is SVG, see my SVG post earlier in the thread. The issue is that to achieve real time 3D requires some calculations and to do this in SVG means using JavaScript which is a wholly interpreted language, so it is much slower than Java and ActionScript which get compiled to Byte Code. So for tens to hundreds of points it's ok, but for thousands it's too slow.

I personally think SVG is a nifty little format but you need a bit of a reality check on your prejudices - SVG is a format created and owned by Adobe, and if you use IE then you are using an Adobe plugin to view it (Firefox does it natively but does not offer full support). Adobe are of course the owners of "evil proprietary flash" :confused:
 
Top