Aven in stereoscopic 3D

Olly Betts olly at survex.com
Thu Feb 15 08:48:42 GMT 2018


On Fri, Feb 09, 2018 at 01:16:41AM +0000, Pedro Silva Pinto wrote:
> #1: Even though a picture is generated for each eye, they are exactly alike.
> In Stereo, you'd expect objects to render left and right with different
> separations depending on their position along the Z axis. You can see in
> this image that deeper parts of the cave are rendered with the same
> separation as the rest. This happens both in plane and profile view (or
> anything in between). Still, a perspective view is being generated, because
> if I drag the view in any direction, closer objects move faster than more
> distant ones.
> 
> #2: Scale is gone. I added glDrawBuffer(GL_BACK) to the start of
> SetIndicatorTranform(), but no scale just the same.

That one's easy - in perspective mode, the scale varies depending how
far away things are so a scale bar isn't useful and so it isn't drawn.

Except there's actually a bug and if you toggle to perspective mode
aven doesn't currently force an update so the scale bar hangs around
until something else forces an update (e.g. pressing F5 makes the
scale bar actually go).  I'll fix that.

> #3: Camera positioning is somewhat affected. On first drawing and
> plan-to-profile changes (and vice-versa) the objects are rendered out of
> view. I need to zoom out to see them.

Aven's current perspective mode is a "worm's eye" view - you are put
into the model (at what was the current centre of rotation in
non-perspective view).  "Zooming out" actually moves the worm backwards.

> Issue #1 is the only major one. I'm guessing the math in the glFrustum call
> needs to be changed (and probably also in glTranslated or glTranslatef
> calls), but I'm clueless right now and the variations I tried didn't produce
> results. Can you take a look?

Will do, though it might take a bit of fiddling as I lack suitable
hardware.

> Attached are the source files I changed. Look for the //PPinto comments.

Please can you send patches next time - they're easy to generate using
git - just:

git diff > changes.patch

If you send whole files they're much larger, and to see what you've
changed I first need to deduce which version of the code you started
from and then generate a patch from that...

Cheers,
    Olly



More information about the Survex mailing list