Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#5991 closed enhancement (fixed)

cross-eyed stereo

Reported by: hps@… Owned by: Tom Goddard
Priority: moderate Milestone:
Component: Graphics Version:
Keywords: Cc: montfort@…, Elaine Meng
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

from Peter Speilmann registration comment: "cross-eyed stero would be helpful"

Since wall-eyed is available, seems like it should be trivial to offer cross-eyed

Change History (6)

comment:1 by Tom Goddard, 4 years ago

It is unlikely we are going to add cross-eye stereo soon because of hundreds of other requests. I suspect very few people would use it. But if you want to try it you could edit a line of the ChimeraX Python code in your distribution. On Mac the file to edit would be

ChimeraX-1.3.app/Contents/lib/python3.9/site-packages/chimerax/graphics/camera.py

line 578 that handles side by side stereo, change

                x[:] += (-1 if eye == 'left' else 1)

to

                x[:] += (-1 if eye == 'right' else 1)

And restart ChimeraX and use the side-by-side camera mode enabled by command "camera sbs". This swaps the left and right eye images so the right eye image is on the left and the left eye image is on the right.

This side-by-side stereo mode is not correct wall-eye or cross-eye. Both cameras look straight ahead as is used in virtual reality. But it is close enough to work for wall-eye and cross-eye.

comment:2 by pett, 3 years ago

Cc: montfort@… added

comment:3 by Tom Goddard, 3 years ago

Begin forwarded message:

From: Tom Goddard 
Subject: Re: Cross-eyed stereo in ChimeraX
Date: June 3, 2022 at 6:44:59 PM PDT
To: "Montfort, William R - (montfort)"

Hi Bill,

While the side-by-side (sbs) camera mode in ChimeraX is passable walleye stereo, cross-eye stereo is harder, it is not simply swapping the two eye images as done by the hack Eric copied from a previous message I wrote.  That swapped image version may cause even more eye strain than usual cross-eye so beware.

We haven't added crosseye because doing it well is harder than walleye.  The right settings depend on how far you are from the screen and how big the graphics window is.  Our current sbs as walleye is also pretty crappy since for larger graphics window size than twice the person's physical eye spacing it will force the person's eyes to diverge (both point outward from straight ahead) which is very bad -- but if the graphics window width is twice physical eye spacing it is correct.

At any rate, the reason I have not added wall-eye and cross-eye is because done poorly it forces your eyes to do weird things that can be harmful and painful.  So it needs to be done right or not at all, and it is hard to spend the time to do it right when so few users will benefit and funding is always short.

If you use it anyways, there is a trick, not sure it is documented that holding the Alt key down while zooming with the mouse changes the stereo eye separation (ie depth of field).

	Tom

On Jun 3, 2022, at 6:10 PM, Eric Pettersen wrote:

Hi Bill,
	No, cross-eyed stereo is still not available in ChimeraX.  There's no ETA for it AFAIK.  There is a feature-ticket for it open in our bug-tracking database.  I'll add you to the recipient list so that you will be notified whenever it does get implemented.  According to that ticket, you can hack the code to switch side-by-side stereo mode to cross-eyed:

It is unlikely we are going to add cross-eye stereo soon because of hundreds of other requests. I suspect very few people would use it. But if you want to try it you could edit a line of the ChimeraX Python code in your distribution. On Mac the file to edit would be

ChimeraX-1.3.app/Contents/lib/python3.9/site-packages/chimerax/graphics/camera.py
line 578 that handles side by side stereo, change

                x[:] += (-1 if eye == 'left' else 1)
to

                x[:] += (-1 if eye == 'right' else 1)
And restart ChimeraX and use the side-by-side camera mode enabled by command "camera sbs". This swaps the left and right eye images so the right eye image is on the left and the left eye image is on the right.

This side-by-side stereo mode is not correct wall-eye or cross-eye. Both cameras look straight ahead as is used in virtual reality. But it is close enough to work for wall-eye and cross-eye.


--Eric
On May 31, 2022, at 5:49 PM, Montfort, William R - (montfort) wrote:

Dear Eric,
 
Was cross-eyed stereo ever added to ChimeraX? I may be the last person standing who still uses this – and I’m missing it in ChimeraX as I write.
 
I hope all’s well for you –
 
Thanks!
 
Bill Montfort
 
________________________________
William R. Montfort
Professor, Chemistry and Biochemistry
University of Arizona
BSW 524
phone: 520 621-1884
montfort@arizona.edu

comment:4 by Tom Goddard, 3 years ago

The Alt key (Option key on Mac) while zooming behaves differently from what I said in the previous comment. A mouse zoom with no key press in a stereo mode just changes virtual eye separation in the scene which makes the models appear to be bigger or smaller but appear the same distance away. Holding the Alt key while zooming moves the models closer or farther away to get a comfortable viewing distance.

comment:5 by Tom Goddard, 3 years ago

Resolution: fixed
Status: assignedclosed

Done. Added in daily build, not in ChimeraX 1.4.

Added "camera crosseye" and "camera walleye" commands. There is also a new camera command parameter "convergence" in degrees set to 10 for cross-eye and -5 for wall-eye (and not relevant for other modes). It controls how much the camera for each eye points inward. For walleye the default -5 degrees helps put the two eye images close enough when the graphics window is physically wider than twice the person's eye spacing (ie. more than about 4 inches wide). The optimal convergence values depend on the window width and user comfort. In using wall-eye or cross-eye it is important to realize there are two zoom mouse modes. The normal model leaves the model at the same depth but changes its size, and the other activated when the Alt key (Windows/Linux) or Opt key (Mac) is held down during the zoom moves the model closer or further away. Using both zoom modes is needed to get the most comfortable view.

comment:6 by Tom Goddard, 3 years ago

Cc: Elaine Meng added

Elaine, can you add camera command documentation for crosseye and walleye and convergence options?

Note: See TracTickets for help on using tickets.