Author Topic: Online 3D file viewing?  (Read 11097 times)

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #25 on: February 26, 2011, 10:23:04 pm »
Footleg: starter for ten ... realtime 3D
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #26 on: February 26, 2011, 10:32:23 pm »
It now does surfaces -  see

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

IE worked fine but Firefox was reluctant to reload the JAR - I had to got to Control Panel -> Java, then on the General Tab - Temporary Internet Files -> Settings -> Delete Files. Then I had to stop and restart Firefox! (Starts to make the flash idea look like a winner).

DOES ANYONE have any bigger .lox examples that use surfaces (doesn't look like the UBSS ones do). I cut a corner with this version and it may need optimising for bigger files - but some test data would be good.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #27 on: February 27, 2011, 07:27:45 pm »
When I say "surface" I mean "Scap" (at least that's what it is called in the Loch source code) - a set of triangles that represents a wall, etc. I haven't done bitmaps yet (nor LRUD which I really ought to ...).
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline Duncan Price

  • forum star
  • ****
  • Posts: 600
Re: Online 3D file viewing?
« Reply #28 on: February 27, 2011, 09:36:09 pm »

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #29 on: March 01, 2011, 09:22:24 pm »
Here's the latest, it now has the surface bitmap in a limited way (see note below) and you can turn on/off various features.

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

With everything turned on, on big surveys such as Charterhouse, it is pretty jerky, best to turn everything except the centre line off to rotate/pan/zoom then turn things back on.

Note on Bitmaps - I haven't implemented skew/rotate for the bitmap tiles. What this means is that when you look at the plan view, the bitmap looks OK, but as you rotate the view the bitmap starts to look crappy. It is going to add a decent computing overhead to implement the skew/rotate and I am wondering if the performance hit is worth it? Let me know what you think.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline footleg

  • Caving
  • forum star
  • ****
  • Posts: 649
  • avid photographer & survey drawerupperer
    • Footleg's Cave Photography
Re: Online 3D file viewing?
« Reply #30 on: March 04, 2011, 11:16:26 pm »
Footleg: starter for ten ... realtime 3D

Is this what you were referring too? This looks promising.
http://www.uselesspickles.com/triangles/

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #31 on: March 08, 2011, 10:30:37 pm »
Finally got around to writing some of this up here.

I have also split off the bitmap drawing into a separate thread, so it draws the lines and polygons and handles mouse activity in one thread and draws the bitmap separately. That way you don't have to wait for the bitmap to be drawn before you can move the lines and polygons.
Try it here

Below is a screen grab of part of the Charterhouse survey (data courtesy of UBSS)


'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline graham

  • Retired
  • forum hero
  • *****
  • Posts: 10943
  • UBSS, Speleo-Club de Perigueux, GSG, SUI
    • UBSS
Re: Online 3D file viewing?
« Reply #32 on: March 09, 2011, 07:46:47 am »
That screen grab was taken from a very peculiar angle.
Caving is for Life not just for Christmas

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #33 on: March 09, 2011, 07:50:17 am »
 :) It needs testing by someone who knows what it should look like. I wouldn't be surprised if the cave was upside down or back to front
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline graham

  • Retired
  • forum hero
  • *****
  • Posts: 10943
  • UBSS, Speleo-Club de Perigueux, GSG, SUI
    • UBSS
Re: Online 3D file viewing?
« Reply #34 on: March 09, 2011, 07:51:20 am »
:) It needs testing by someone who knows what it should look like. I wouldn't be surprised if the cave was upside down or back to front

I should know what it looks like better than most. I'll send you a PM.
Caving is for Life not just for Christmas

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #35 on: March 12, 2011, 07:12:52 pm »
So how do I show the surface bitmap in Loch?
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline graham

  • Retired
  • forum hero
  • *****
  • Posts: 10943
  • UBSS, Speleo-Club de Perigueux, GSG, SUI
    • UBSS
Re: Online 3D file viewing?
« Reply #36 on: March 12, 2011, 10:24:18 pm »
So how do I show the surface bitmap in Loch?

If there is one present it should show automatically.
Caving is for Life not just for Christmas

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #37 on: March 13, 2011, 08:41:09 pm »
I see the surface as shaded polygons but not the bitmap. I've tried several files, all of which have bitmaps - al least they show up in my viewer (albeit the wrong way round)

 :confused:
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline footleg

  • Caving
  • forum star
  • ****
  • Posts: 649
  • avid photographer & survey drawerupperer
    • Footleg's Cave Photography
Re: Online 3D file viewing?
« Reply #38 on: March 13, 2011, 11:39:43 pm »
I've had the same problem with some graphics cards. So on some computers the surface bitmap does not appear. On others it works fine. Works fine on a VMWare virtual machine which is my fall back option on awkward hardware.

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #39 on: March 14, 2011, 07:36:14 am »
 :thumbsup: thanks footleg, nice to know I wasn't missing something obvious
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #40 on: March 14, 2011, 09:07:05 pm »
The inverted bitmap has been doin' my 'ead in :wall: but I've got it fixed now, however looking at the Charterhouse bitmap and comparing it with the surface polygons, the valleys don't seem to be quite right. Since I can't see the bitmap in Loch, could someone let me know if it correct?

I've also changed the mouse handling so that it is more like Loch, so Left Mouse Drag Up/Down zooms, Left Mouse drag left/right rotates, Scroll wheel (or shift left mouse drag tilts) and Right Mouse Drag pans. I'd like to get it rotating about the centre rather than about the corner, but that's for another week.

http://chris-h.me.uk/loch/LochViewer.php
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline Duncan Price

  • forum star
  • ****
  • Posts: 600
Re: Online 3D file viewing?
« Reply #41 on: March 14, 2011, 10:35:26 pm »
Hurrah - it finally works for me on IE8!

I'll try to work up the Ogof Capel survey for you into a .lox file with the surface overlay.  Pity I can't do Draenen...yet.

Offline graham

  • Retired
  • forum hero
  • *****
  • Posts: 10943
  • UBSS, Speleo-Club de Perigueux, GSG, SUI
    • UBSS
Re: Online 3D file viewing?
« Reply #42 on: March 14, 2011, 10:55:56 pm »
Pity I can't do Draenen...yet.

Take a look in the repository  8)
Caving is for Life not just for Christmas

Offline graham

  • Retired
  • forum hero
  • *****
  • Posts: 10943
  • UBSS, Speleo-Club de Perigueux, GSG, SUI
    • UBSS
Re: Online 3D file viewing?
« Reply #43 on: March 14, 2011, 10:59:51 pm »
The inverted bitmap has been doin' my 'ead in :wall: but I've got it fixed now, however looking at the Charterhouse bitmap and comparing it with the surface polygons, the valleys don't seem to be quite right. Since I can't see the bitmap in Loch, could someone let me know if it correct?

If it is wrong (this netbook has too small a screen to tell, easily) then I think it might be that the bitmap and the surface are different sizes. Providing the file has the right numbers in it lox will clip the bitmap appropriately but that might be trashed by your viewer. I know that one of our bitmaps is the wrong size & I think it is that one.
Caving is for Life not just for Christmas

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #44 on: March 18, 2011, 08:14:00 pm »
I have just put up the latest and greatest - I think this is pretty much ready to be called version 1, unless someone can spot something obvious.

It now has plan/elev buttons and just for Graham a full screen button. The mouse handling is improved and you can also use the cursor keys and Pg Up/Pg Dn for zoom.

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

I'll try to get it written up with some notes on how to install it on your own website.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline TheBitterEnd

  • forum hero
  • *****
  • Posts: 1460
  • KCC
    • KCC - Join an active club
Re: Online 3D file viewing?
« Reply #45 on: March 24, 2011, 10:15:08 pm »
Since Firefox 4 came out with its improved Javascript engine, I thought I'd stretch its legs a bit, so I did Little Neath as SVG and it seems just about useable

http://interestingto.me.uk/3d/svg/lnrc.svg

But then I thought I'd give the HTML5 Canvas tag a whirl and w00t,w00t it's pretty good (remember this is with Firefox 4, it's still pretty slow in 3) You can also use right-drag and scroll wheel which are not available in the SVG version.

http://interestingto.me.uk/3d/canvas/lnrc.html

It's never going to do surface bitmaps directly though but could be pretty useful nonetheless.
'Never argue with a fool, onlookers may not be able to tell the difference.' — Mark Twain

Offline Martin Laverty

  • menacing presence
  • **
  • Posts: 196
Re: Online 3D file viewing?
« Reply #46 on: March 31, 2011, 05:38:41 pm »
I have done some experimentation with the <canvas> approach and slightly modified its 3D routines in javascript: it does look a very promising approach.

I have loaded a model with [OUCC,NPC,CDG,SIE] data for the caves around Ario in the Picos de Cornion, Spain (extracted from a database created with SQL from Therion): well over 5000 stations and shots. They can be moved smoothly in Google Chrome and Opera browsers, sluggishly in Firefox 3, but IE users will see nothing at all (except, perhaps, in IE9). You can try it at:

http://www.mlaverty.plus.com/culiembro.html

Chris Jewell's article, "Hallazgo Hitu", in Descent 219 (just out) shows a plan of the Culiembro part,  for comparison, and, for reference, here is a screenshot of a plan (subsequently labelled with system names for information, N at top, scale ~ 3x2km):

and an elevation viewed from slightly north of west (just over 2km top to bottom):


There are still problems, room for improving the ease of use and interpretation, but lots of possible avenues of development: sirch2/TheBitterEnd has done a great job in getting this going.