Introduction to Anaglyph Stereoscopy in Excel – part #1: a more efficient composite rotation in the 3D Cartesian space

I made a stereoscopic model in October last year, however, choosing the wrong colors (red and blue on a black background, the effect was very weak (if any). This series was suggested to me last week by one of the guests here on the website, Don L. (thanks Don!), who sent me his stereoscopic cube. I opened the model, put on my goggles and his cube literally popped out of the screen. I realized that white (which I always avoided)  is a a good background, which combined with a red object and another a light blue offset object all make a nice setup for stereoscopic imaging. The red can be almost anything (orange, yellow and even green). Now I quote from Wikipedia: “Stereoscopy (also called stereoscopic or 3-D imaging) refers to a technique for creating or enhancing the illusion of depth in an image by presenting two offset images separately to the left and right eye of the viewer. Both of these 2-D offset images are then combined in the brain to give the perception of 3-D depth. Three strategies have been used to accomplish this: have the viewer wear eyeglasses to combine separate images from two offset sources, have the viewer wear eyeglasses to filter offset images from a single source separated to each eye, or have the lightsource split the images directionally into the viewer’s eyes (no glasses required).” This part of the tutorial introduces the reader to a more efficient implementation of the composite object rotation in a 3D Cartesian space.


This article has 11 Comments

  1. Francisco, I got the file but I still don’t understand what you want me to do. There are some lines there and it is hardly anything you can do with a line in 3D. If you however have a shape and you don’t understand the tutorials just take one of my files and plug in your 3D data instead of the original data and you are ready to go. My files are fully functional, they rotate the shape and it’s stereo-3D. Cheers, George

  2. Hi, George

    I checked your website everyday. Great work. You, unlike others on utube,
    sahre a a lot of knowledge.
    I have learned a grest deal of knowledge by now.
    I created a moving 45 degree graph by using the offset. I will email you my work.
    I have a question. I wonder how can I apply the Stereoscopic Excell Rotationg Techniques to make my animated 45 degree graph rotate in 3D like the one that is presented
    in utube: Parameterizing a Circle – Animated spreadsheet


  3. Thanks for the clarification, Peter. That sounds very good!
    Do you happen to have 3D glasses at home??? I am posting something very elementary today but the possibilities are quite promissing.

  4. Just noticed I did not respond to your ‘CV speculation’. My technical background is math, some theoretical physics, astronomy, aircraft structures, FE methods, design optimisation. As a math graduate I learnt “don’t attempt to remember anything you could work out”; understanding, not memory, drives the show. More abstract concepts are part of the understanding though, particularly when they may be applied to seemingly widely different application areas.

    A reasonable degree of overlap with your ideas and motivation I think.

  5. Thanks, Don! I will check it out. The whole stereoscopy is a gross approximation to start with and if I look at 3D images and see how how far from reality they are I think a 3% aproximation could not be perceived even by a trained person. However this 3% approximation comes with a massive cut in the amount of calculations. Moreover retrofitting a file for 3D with this approach is a breeze. A file like the coaster must take minutes to upgrades especially if you put everything in a nice custom defined vba function. All the best, George

  6. Hi George, yes the range scope does work on the same principles and I have now managed to get the email to send to you. Take a look at what I’ve done, play with the controls for eye separation and the binocular angle (the degree to which you cross-eye the direction of the scopes in the range scope analogy and you will find the medium that suits you.
    I also did equate the right eye v’s to the left eye v’s and the result is still fine, so it’s reasonable to use this approximation. In fact, even though it’s an approximation, it is easier to see. and this is because it is an approximation of what you should see in your peripheral vision if you’re looking at the centre of the scene, but it’s inaccurate if you’re not looking at the centre of the scene, but the peripheral objects directly. in that case, using the same v’s for left and right eyes becomes more pleasing to view than having the vertical difference making things uncomfortable for your eyes trying to accommodate vertical mismatches. I will now send the second version of the roller coaster that uses v_right = v_left.

  7. Don. Thanks for the reminder of Affine transformations. I had a vague memory that perspective transformations could be handled with a single 4×4 matrix multiplication but the mysteries of the glide reflection and other delights were a long time ago.

  8. Thanks Don! I didn’t find the file in the support inbox. I now how to do it as two simple translations in the “u” parameter of the 3D-2D conversion and last night at the gym I figured out very a very neat way of understanding and explaining it. It is essentially just like using a “scissiors telescope” from in artillery or telemetry. To enhance the perspective view much more than your eyes can do you take two images from the right and left or your head with a span between the “objectives” or between cameras or 1 or a few meters let’s say. Then, using periscope type prisms you bring the the two images together (in case of photography you mount one camera at an arm lenght to the right and another one at an arm length to the left at the shoulder height and both facing forward, or slightly inward depending on the effects you want to achieve). Therefore now, after bringing the pictures or images together at a distance between themselves equal to the eye-span, deliver them separately to each eye (right to right and left to left). Of course the brain will make you look cross eyed while watching areas in the photographs close to the imaging point and look straight while watching the horizon. This is just like real life. If you make a small game you need to set the scope-span small and in the case of a flight simulator (you are quite far from the scene) you need largely spaced collection telescopes (cameras) in order to perceive 3D. You should fix the inter eye span (offset) and adjust the telescope offset depending on the scene (like in the case of a scissior scope you can adjust the angle from 0 (a simple trench telescope) to 180 degrees for full telemetry depending on the purpose you need to achieve). There are some v-errors but they are very small (few percent). You won’t ever notice them. Actually in real movies those differences are bad and people try to get rid of them. Once you understand the scissior scope analogy the geometry and math are trivial and the model is just slightly more complex except for charting 2x the number of points.

  9. George,
    Thanks for the reference to the example that I sent you and I am also sending you one with the roller coaster implemented with affine transforms as the method for rotations and translations. Check for that on the support inbox. It was done on Excel 2007 as alas I don’t have 2003 on my home machine at the moment.
    I have implemented controls for the separation between left and right eyes, the “binocular angle” to use to rotate left and right scenes by and a “depth” behind the screen where the rotation z axis is located. Play around with these to see that you change the depth of the scene and the apparent depth within the scene of the screen plane.
    I am still thinking about whether there is a shortcut by making just an offset left to right instead of the rotation of the scene, but if you do that, the whole scene appears behind the screen and none of it comes forward. I’m also considering whether it works to use a common v coordinate in the two perspective views as would be valid if there was no rotation of the right eye scene compared with the left. With the rotation of the scene about an axis somewhere behind the screen plane, then points on the ground plane will have different v’s left to right anywhere off the centre vertical axis of the view.
    Will continue experimentation tomorrow morning and let you know my findings.

  10. Peter, Thanks for posting here. Don’t impose any restrictions on yourself. If it’s not 90% fun, don’t do it. If you do it, take as much time as you like, even months if you like. I sometimes get stuck myself. Are you a mechanical engineer and FEA guru? If yes, you are the person I need on this site the most.
    Coordinates do mix. I have a solution and it’s in the coaster. You need two unit segments (like a letter L), one longitudinal (with the plane) and one transversal, say parallel with your vertical stab. As you fly you need to integrate the controls (by doing the copy paste operation for these 2 segments) to find the final linear and angular coordinates since the controls are “derivative” devices. After that you apply the 3 rotations and three translations backwards for the whole scene in order to find your true position(x, y, z, alpha, beta, gamma). I have it all worked out, I just need to make a series about it. How did you think I created the coaster? By using the old “flying” method while the generated “contrail” was the coaster itself. How do I ride it? By using the method you are talking about now and which I will be using soon for the RC plane and helicopter simulator. Two years back while making the coaster I encountered control mixing issues myself. That’s why I need to make tutorials, so that I know how to do it next time from the first shot.

  11. George. I am still here but realistially I am unlikely to write anything for you on refraction before I get back from the NAFEMS Conference in Boston. Especially if your other posts keep throwing up interesting challenges!

    With the flight simulator in mind in particular, I find the sequential application of rotations about co-ordinate axes something of a nightmare; especially so, in that the order they are applied changes things once the rotation angles start to get large.

    What I did instead was to work out the rotation matrix corresponding to a large angle rotation Omega about an arbitary direction defined by components (direction cosines if you insist) (n1, n2, n3). The other calculation was to start with a arbitrary, numerically specifed rotation matrix and extract the axis rotations from an ‘asin’ and two ‘atan2’ operations.

    As with any ‘home developed’ solution, I suspect I should now be able to find it in text books but that’s just life.

Leave a Reply

Your email address will not be published. Required fields are marked *