From: Bruce S. <Bru...@nc...> - 2005-01-23 20:21:33
|
A particularly easy way to achieve this effect in an existing program is to add the statement scene.stereo = 'passive' For a specific example, see stereo.py in the "Contributed programs" section of vpython.org. And note that scene.stereodepth can be used to move the scene forward. Further details are in the section on "Controlling windows" in the on-line reference manual. Bruce Sherwood John Brawley wrote: > FYI, anyone trying to do real 3D stereo: > There is a nifty simple "kludge" that gives stereo without additional code. > > You must of course use two side-by-side windows, with the usual > "scene=display(title..."(etc.) code. > > First window's "center=" numbers should be (0.35,0,0) > Second window's "center=" numbers: (0,0,0) > > This will very slightly offset one window's contents from the other's, but > it also gives real 3D depth to what's in the scene. The 'camera' apparently > shifts somewhat in the 'x' direction, which is enough to do the necessary > brain-fooling trick. ( IOW, I don't know _why_ this works, only that it > _does_ work.) > > To increase or decrease the apparent depth ("hyperstereo" or less depth), > slightly increase or decrease the first number ("0.35" in the above > example). > To invert the stereo (use "walleyed" freeviewing instead of crosseyed > feeviewing), make that number negative. > > Now, I can't guarantee that it'll work properly with just _every_ > conceivable object or set of objects, but it works perfectly with my > particular object-set, which is a grouping of small spheres being compressed > together inside an invisible larger sphere. > > I discovered this when trying to learn to use VPython, and having enormous > difficulty trying to find and use code that would give me stereo. VPython's > windowing system is probably not _designed_ to do this, but it does do it, > and does it without a shred of "stereo-specific" additional code. > > Just passing learned stuff to the list. > Thank me only if you a) want to do stereo, and b) try it and it works for > you as well. > (*grin*) > > John Brawley > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users |