Okay, boys and girls, grab your 3D glasses and gather 'round the TV (or VGA). .
Phil Pilgrim (PhiPi)
Posts: 23,514
... It's time for Dr. Tongue's Evil House of Pancakes! (Oooooh! Pretty scary, kids!)*
Okay, first a confession: I'm supposed to be writing documentation for a new product. The doing isn't that onerous, really, it's just the getting started. And that's where avoidance activity comes in. I thought, "I can do this in a day or two. It'll be okay; I won't lose that much time, and it'll be fun!" Fun! Yes, indeed: that's the best part of being bad!
Well, that was more than a week ago, I've been staying up late, and my writing and other commitments are way behind schedule; but it sure has been fun! And now it's finished — for the time being.
What I'm so giddy about is a new 3D graphics driver that produces anaglyphic stereo output on a TV screen. You need red(L)/blue(R) -O^O- 3D glasses to view the output, and it can display wireframe models of solid objects. I started with Chip's Graphics.spin driver and, like Yoda with Luke's provisions locker, started pitching stuff out. Arcs? Gone. Text? Nope: gotta make some room. Basically what was left were points and lines. And even those got modified (by weeding out some ANDNs) to allow transparency between the left and right views.
From there, I could add the 3D->2D projection math, along with some math for a transformation matrix (scaling, rotations, translations). Then came a macro function for displaying entire wireframes in assembly.
The demo archive is attached. I'm not going to post any photos of the output. That can be a surprise. It can work with a mouse or without. With the mouse you can manipulate the image in real time; without it, the image changes by itself.
The software is optimized for a 12" TV screen. There are two parameters that could use better handling: eye separation and observer distance from the screen. I accommodated both with shifts instead of multiplies and divides. This helps with speed, but doesn't do much for flexibility, so it's something I need to get back to. Picking the colors was a bit tricky, too. NTSC doesn't give you very exquisite control over which phosphors get lit up and where. So you have to find color combinations that separate well and don't leave much ghosting. Even picking a background color can be a challenge (black doesn't work). It needs to camoflage the blues through the red filter, and vice versa, so you don't see shadows or auras where they don't belong.
For those wishing to try their hand at programming, here are the specs:
I'm always happy to entertain suggestions and questions. In the meantime, "Would you like some more syrup?"*
-Phil
* For anyone not familiar with SCTV's Count Floyd, here's a link to the now-classic House of Pancakes skit:
····www.karcreat.com/SCTV-CountFloyd.mp4
Update: Added a VGA driver and consolidated the demos. Note: Zip is no longer a full archive, but just the 3D stuff.
_
Post Edited (Phil Pilgrim (PhiPi)) : 6/14/2009 9:29:20 PM GMT
Okay, first a confession: I'm supposed to be writing documentation for a new product. The doing isn't that onerous, really, it's just the getting started. And that's where avoidance activity comes in. I thought, "I can do this in a day or two. It'll be okay; I won't lose that much time, and it'll be fun!" Fun! Yes, indeed: that's the best part of being bad!
Well, that was more than a week ago, I've been staying up late, and my writing and other commitments are way behind schedule; but it sure has been fun! And now it's finished — for the time being.
What I'm so giddy about is a new 3D graphics driver that produces anaglyphic stereo output on a TV screen. You need red(L)/blue(R) -O^O- 3D glasses to view the output, and it can display wireframe models of solid objects. I started with Chip's Graphics.spin driver and, like Yoda with Luke's provisions locker, started pitching stuff out. Arcs? Gone. Text? Nope: gotta make some room. Basically what was left were points and lines. And even those got modified (by weeding out some ANDNs) to allow transparency between the left and right views.
From there, I could add the 3D->2D projection math, along with some math for a transformation matrix (scaling, rotations, translations). Then came a macro function for displaying entire wireframes in assembly.
The demo archive is attached. I'm not going to post any photos of the output. That can be a surprise. It can work with a mouse or without. With the mouse you can manipulate the image in real time; without it, the image changes by itself.
The software is optimized for a 12" TV screen. There are two parameters that could use better handling: eye separation and observer distance from the screen. I accommodated both with shifts instead of multiplies and divides. This helps with speed, but doesn't do much for flexibility, so it's something I need to get back to. Picking the colors was a bit tricky, too. NTSC doesn't give you very exquisite control over which phosphors get lit up and where. So you have to find color combinations that separate well and don't leave much ghosting. Even picking a background color can be a challenge (black doesn't work). It needs to camoflage the blues through the red filter, and vice versa, so you don't see shadows or auras where they don't belong.
For those wishing to try their hand at programming, here are the specs:
- Point (0, 0, 0) is at the center and on the surface of the screen. X and Y directions are as you'd expect. +Z is towards you; -Z, into the screen.
- Coordinate scaling for drawing points and lines directly (to fill the screen) is, roughly: X from -30000 to 30000 and Y from -22000 to 22000, give or take, depending on Z.
- Coordinates for packed wireframe points can run from -1023 to 1023 in all directions and are automatically scaled up by 16 before being drawn.
- Transformations include scaling, rotation (pitch, roll, and yaw) and translation. These are applied to the subject, not to the observer.
- Transformations should be applied before sending drawing data. Do scaling first, then rotations, with translations being last.
- You can incrementally accumulate transformations from frame to frame, but it's better to start each frame anew and to apply the accumulated transformations in aggregate to avoid round-off issues during the matrix multiplications.
- The "color" routine takes one of two values: 0 = erase; 1 = draw. It defaults to "draw".
I'm always happy to entertain suggestions and questions. In the meantime, "Would you like some more syrup?"*
-Phil
* For anyone not familiar with SCTV's Count Floyd, here's a link to the now-classic House of Pancakes skit:
····www.karcreat.com/SCTV-CountFloyd.mp4
Update: Added a VGA driver and consolidated the demos. Note: Zip is no longer a full archive, but just the 3D stuff.
_
Post Edited (Phil Pilgrim (PhiPi)) : 6/14/2009 9:29:20 PM GMT
zip
22K
Comments
Got some 3D glasses at home (from seeing "My Bloody Valentine" - a terrible movie, but now I feel absolutely justified in having gone to see it!)
Can't wait to get home and try it out.
Ross.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina
Post Edited (RossH) : 6/11/2009 7:32:23 AM GMT
Some people can't see in 3D, BTW. We were using 3D techniques where I once worked, so I tested everyone in our group for stereo perception.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Post Edited (Leon) : 6/11/2009 8:53:55 AM GMT
Combine this with some kind of accellerometer, and or a laser scanner, and you have a virtual interactive 3D interface.
And now we have the beginnings of the first propeller TV 3D Interactive Interface.
Anyone interested?
Can you say minority report?
[noparse]:o[/noparse]
An interesting project would be to have a prop output to 2 TV's and input 2 laser scanners, you have the first 3D PONG game.
Each player on one tv, with their own scanner.
Can the prop do 2 TVs?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
TERMS OF USE: MIT License
"Permission is hereby granted, free of charge, to any pers...........................
..............................OMITTED FOR FORUM...............................................
.................. OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. "
Post Edited (Clock Loop) : 6/15/2009 2:41:53 AM GMT
By increasing/decreasing the contrast of only the 'a' or only the 'b' pixels and shifting them left,right, up,down (I think) you can trick the brain with the dominant eye verses recessive eye into seeing two slightly different images and perceiving the difference as varying depth.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
'Interesting idea. Do you think the Propeller could do this?
Another method I saw used a plastic diffraction grating. The glasses were being passed out at Best Buy years ago to promote something called "I Love the 80s 3D". It was done in ChromaDepth and relied on the grating shifting blue and red differentially, which makes the red seem to appear in front the blue. This isn't true binocular vision, but an interesting concept nonetheless.
-Phil
I don't know if the Propeller could do it or not, I'm really not sure... I recently saw the movie "UP" with my daughters, and the 3D glasses used there are the Polar glasses. Now what I've read indicates that there should have been two movie projectors, but I didn't see a second projector at the theater. Looking at the screen with vs. without the glasses showed an image as I tried to describe although I could not see the interdigitation this was an assumption on how you might get a similar effect... just one image super imposed and misaligned over another image with diminishing quality or fading of the secondary image is all that I could observe.
The limitation of colors and resolution are what might prevent this on the Propeller, but again this is an area I am not familiar with, so I can't say for sure.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
You can view it with 3D glasses. The image in the demo is somewhat more complex and includes moving parts.
-Phil
Beau:· I've wondered about 3D projectors too...· I think it must have something like one of these Z screens inside:
http://www.reald.com/Content/RealD-LP.aspx
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
Thanks for the Count Floyd flashback!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Whit+
"We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
-Phil
I really want to see this, but I don't have any glasses with me. I have about 50 pairs back at Parallax.
A few years ago, I looked into 3D display possibilities for the Propeller. I tried LCD shutter glasses, but they were too dim, and rather pricey. Polarization was out of the question. By a big margin, the red/blue approach was the most promising. The limitation is that you get a monochrome image, but it's very practical to implement. I noticed, too, that you needed·a neutral background on which to draw your red/blue lines, so that your brain would put them together without too much ghosting. I found a source of good plastic glasses for $1 each. I bought a bunch because I was hoping to do what you've done.
Good job on doing this. I REALLY want to see this run.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
I suppose you could also output different images to two monitors and cross your eyes and look at the image in the middle..LoL
Or output two images on a single screen and rig up some sort of contraption with two cheap lenses that you put up to the screen
and look through...like an old streopticon slide viewer.
Maybe take a pair of dark goggles and mount 2 small lcd monitors and 2 lenses and have a real VR headset.
There are some nice and cheap LCDs from cell phones.
One thing I've learned in doing this is that, with low-res images, motion helps a lot. It really smooths out the jaggies and gives the impression of higher resolution.
Several years ago, I bought a bunch of different anaglyphic 3D glasses, both the cheap carboard type and some nice plastic-framed ones, in both red/blue and red/cyan. The red/cyan worked well with color 3D images on a computer screen but not so well with the video stuff. More surprisingly, I got much better color separation with the cheap carboard glasses than with the nice ones. I contacted the outfit that sold them to me, and they said they were aware of the difference but that they were only importing them and didn't have any control over the filter quality.
I've also tried shutter glasses that switch on the even/odd NTSC field boundaries. They came with a really terrible 3D movie on VHS. Compounding that, they were extremely uncomfortable to wear and gave me a headache. OTOH, I've experienced shutter glasses in an IMAX theater that were simply amazing. I guess it all depends on the frame rate.
BTW, thanks for providing the code foundation that made this extension possible!
-Phil
I know my cheap 3d glasses are in my shop SOMEWHERE!
Now I've got to clean my shop.. [noparse]:)[/noparse]
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Visit the: The Propeller Pages @ Warranty Void.
Post Edited (Oldbitcollector) : 6/12/2009 2:18:01 PM GMT
Great Job! As soon as I finish my lab (a week?) I'll hook up the ol' demo board and try this out!
You mentioned motion smoothing out lo-res video. I can't agree more. Especially if you use anti-aliasing/sub-pixel hinting (or have a tv that is so blurry it doesnt matter).
Take it easy,
Chris
Yes, motion helps a lot. Another thing motion does is all us to see objects as objects, when drawn in wireframe. When an image is static, it can be seen as popping in, or out, or as just a bunch of lines and arcs. If you concentrate on a wireframe image, you can actually flip it as any isometric view results in either the real object, or a mirror image one. I used to do sheet metal wireframe a lot, and once designed a mirror image part because of this. Dynamic viewing was not available at the time this gaffe happened.
With CAD, moving the display camera also helps with assemblies, in that somehow the brain can sort out individual parts more easily, even if all wireframe entities are the same color! Used to do it all the time before we got cheap solid modeling.
There is another approach for 3D that makes sense here with an ordinary TV display.
If the signal is non-interlaced vertically, we get 60 frames per second. Polarized glasses really require two projectors, each delivering a polarized signal. I've got several 3D glasses. Red blue, red green, polarized, and the shutter kind.
The shutter kind basically uses an LCD sheet to mask each eye, while the display is drawing a display for the other one. To use them, the hardware must toggle the shutters during the blanking period, and draw each view interleaved with the other one. Left, Right, Left, Right, for a 30Hz stereo display. SGI computers used this approach and it worked fairly well, particularly with lower contrast images. It was possible to get wireframe, solids and textured solid 3D images this way.
I'm pretty sure the shutters are just +5 Volts on each shutter pin, with a ground.
One thing I always wanted to try was toggling the shutters on the HBLANK period. Don't know if they are fast enough though. 30Hz will give the average Joe a headache after about 15 minutes of continuous viewing. If the shutters were fast enough, perhaps high contrast images would work well, in this mode. Each eye gets one scanline, and the user turns up the brightness to compensate for whatever attenuation results from the faster shuttering. There would be motion tearing when the viewer moves their head, but not the more massive 30Hz flicker.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Wiki: Share the coolness!
Chat in real time with other Propellerheads on IRC #propeller @ freenode.net
Safety Tip: Life is as good as YOU think it is!
I even copyed and pasted the pin settings in the DAT from the Hydra Graphics Demo.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.
If it's not Parallax then don't even bother. :-)
Propeller SRAM TV driver winner: ==NOT COMPLEATED: 3 WEEKS UNTIL ENDING TIME==
I'm not familiar with the Hydra. Which pins are used for the video and mouse? Did you see any video output at all?
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve
Propalyzer: Propeller PC Logic Analyzer
http://forums.parallax.com/showthread.php?p=788230
Regards
Gianni
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
-Phil
(exept for the fact that I have no 3D glasses!!) :-(
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Toys are microcontroled.
Robots are microcontroled.
I am microcontroled.
If it's not Parallax then don't even bother. :-)
Propeller SRAM TV driver winner: ==NOT COMPLEATED: 3 WEEKS UNTIL ENDING TIME==
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:
· Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Basic Stamp,···· Propeller,·· · SX,·· FUN!
START:·
>Proccessing Data. . . .··
>Task Complete. . .·.
>Saving Data. . . .
>Entering SLEEP Mode. . . .
>Signing OFF
·
Update: the VGA_text demo works fine at a resolution of 512x480. I've edited "3D_VGA_Graphics" to use values found in "VGA_Text" and it's working now. The updated DAT section follows.
Thanks
Lawson
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
DogP
-Phil
I too recently saw the movie up and noticed a great improvement in the quality of the 3D image. There was still only one projector, and I think they use a silver screen to maintain the polarization of the light. I remember reading somewhere some company made a tv that could control the polarization of the displayed image with a 120Hz refresh rate. One of these paired with a propeller would be impressive and it would allow more color and contrast to be viewed with polarized glasses. Just imagine what a prop 2 could do...