Aven in stereoscopic 3D

Pedro Silva Pinto pedrospinto at netcabo.pt
Mon Feb 5 12:39:03 GMT 2018


Thanks Jarv, I'll give Pymol a try.

However, I'm still hoping to get stereo 3D in Survex. That would be the perfect solution, given the fact that it's so fast and simple to get this spectacular visual result that brings the caves alive to people who don’t actually go into them. Using yet another software (like Pymol) would add lots of extra work to each survey I'd want to present.
Because Survex already relies on OpenGL to render the 3D window, I think little work is needed to make it possible.

So, being the interested part here, I think I'll get my hands dirty. I got the testing platform (the 3D system, I mean) and have just successfully tried compiling survex from source code in Ubuntu. The bad news is I haven't programmed in C in years (I do program in PHP everyday, though) and never tinkered with OpenGL before, so I may need a little guidance, if one of you guys is willing to help. Still, I've got a pretty good idea of what needs to be done. If I'm not wrong, I'll only need to edit the source code files gla-gl.cc, aven.cc and maybe gfxcore.cc too.

For what I was able to find out, OpenGL is implemented in Survex using the wxGLCanvas and wxGLContext classes. From their documentation it seems that stereoscopy is supported. To move from a plain 3D implementation to full stereoscopic 3D, a few things are needed:
- correctly set up the canvas for 3D stereo: easy enough done by adding the WX_GL_STEREO property to the window attributes array (gla-gl.cc and aven.cc);
- introduce a loop to run the drawing sequence twice - one for each eye - between the StartDrawing and FinishDrawing calls (gla-gl.cc);
- alter the math for the lr variable to account for the parallax (eye separation) for the glFrustum function call. Not sure if the math for the glOrtho function call needs to be changed too.

Just before sending this email, I added to the code only the first item on this list (add the WX_GL_STEREO property) and, sure enough, when I ran Aven my 3D glasses started working. So, I think I'm on the right track! :)

Best,

Pedro


From: Jarvist Moore Frost [mailto:jarvist at gmail.com] 
Sent: 1 de fevereiro de 2018 00:07
To: Pedro Silva Pinto <pedrospinto at netcabo.pt>
Cc: survex at survex.com
Subject: Re: Aven in stereoscopic 3D

Perhaps easiest is to extract the data & use with a more mainstream viewer.

I had a lot of luck with Pymol (designed for biological molecules / molecular dynamics), and Thomas Holder's python library for directly importing .3d data:
https://github.com/jarvist/migovecsurveydata/tree/master/scripts/pymol

Example video:
https://www.youtube.com/watch?v=s68V9EsRvmE

Pymol is open source, but a lot of the web links direct you to the pay version.

Pymol supports all kinds of weird and wonderful 3D outputs, including shutter glasses. Mainly I've just used the 'cross eyed' stereo and anaglyph (coloured 3D specs).

Back in ~2011 I wrote a C program that linked to Survex and exported the .3d file to a '.CGO' set of graphics primitives. This was a bit more clunky, but also worked fine.

Best,

Jarv

On 30 January 2018 at 20:50, Pedro Silva Pinto <pedrospinto at netcabo.pt> wrote:
Hi,

Is there any way I could take advantage of the OpenGL 3D capabilities of my
Nvidia Quadro graphics card and see my surveys in Aven in Stereoscopic 3D?

Regards

Pedro


--
Survex https://lists.survex.com/mailman/listinfo/survex




More information about the Survex mailing list