CompuServe Messages

#3DS -> RDS

    30-Mar-94 22:34:32
Sb: #3DS -> RDS
Fm: John K. Jordan 71174,711
To: all
To y'all who were and those who might be interested… I've made some SIRDS (Single Image Random Dot Stereograms) using geometry created with 3DS. RDS images are, as Matt Drury (from GRAPHDEV) puts it: "…those funny 'random dot' images you see so much at malls and flea markets nowadays. We've made them available in GIF format, and also offer moral support to those who can't see them." If you have 3DS, you have most of what it takes to make your own. It's clean, easy, and good for some cheap thrills. While there are several programs available for generating these images, I've just tried one, and that just briefly. (read: there is a lot of room for experimenting and improvement here) RDSGEN takes a greyscale image file as its source, wherein objects close to the camera are WHITE and objects far away from the camera are BLACK. This file can be TGA or GIF, but the GIF files from 3DS are easier to use and more reliable. (3DS TGA's require some geometry or image flipping gyrations to use them with RDSGEN, otherwise the images come out inverted.) The greyscale source image is easily created using the Distance Cue feature of 3DS. I also tried mapping a greyscale gradient map sideways on the whole scene but couldn't see a clear advantage to that method. A small problem is the limited greyscale in the palette that 3DS seems to use when generating GIF images. Unless used with a custom palette, a typical greyscale GIF image only contained 25 distinct colors, where rendering with a custom greyscale palette or to a greyscale TIFF would give me 194 levels of grey. Since the quality of the final RDS image depends on the number of levels of grey in the image, the options are 1) use a custom greyscale palette, perhaps created with a ramp in AniPro, 2) render to a TGA and deal with the flipping gyrations mentioned above, or 3) render to a TGA or mono TIF and convert to a GIF file with an external program before using RDSGEN. (Question for the Yoster: why does 3DS TIF give a nice grey palette and a 3DS GIF only give a few greys in a mostly color palette. Oops, I think I just answered my own question.) ————————————————————– Besides 3DS, a monitor, and perhaps a printer, you need some software. GO GRAPHDEV and download RDSGEN.ZIP (139186 bytes) from LIB 10 (3D/RDS SOURCES). RDSGEN.ZIP will give you RDSGEN.EXE (freeware), the C-source code to play with, and some other stuff you don't need. You can also get RDSGEO.TXT for the algorithms behind all this. All that said, here is the fun stuff: – Create a greyscale palette in AniPro using the ramp option and save to a .COL file. – Create a 3DS file with geometry. Since there is limited detail in the RDS image, make the geometry as simple as possible, with large shapes. I got more "depth of image" when I exaggerated the thickness of the objects somewhat by 2D scaling. – Make ALL objects in the scene white and 100% Self Illum. – Use no Omni or Spot lights in the scene. I set Ambient light to 255 on a suggestion from someone else, but I don't think that is important. – Select Render/Setup/Atmosphere and turn on Distance Cue; verify that Near=0 and Far=100. – Create a camera view to render. – Set a camera range to define the foreground and background. (very important) In the top view, select Camera/Range and set the range extending from "somewhat in front of the closest object" to "just behind the furthest object". This, plus the positions of the objects in the scene may require some playing with, since an object that appears "in your face" in the final RDS image will be difficult to focus on. – Switch to Keyframer (arg!), choose Render/Setup/Configure and set your greyscale palette as the Custom palette. – Switch back to the Editor and render the camera viewport, NO dithering, Phong, to a GIF file. Try with antialiasing OFF since the intermediate grey pixels produced would only serve to confuse the RDS edges. – From DOS, run RDSGEN to create the RDS image. Lots of options in RDSGEN. One to try first will give a fine color random-dot pattern with little index marks to help in diverging your eyes: RDSGEN input.GIF output.GIF -c -i -a4 A lot more fun is using another GIF file as a background image. (That's the way most of the images you see in the books are done.) Start with a GIF file that has a more-or-less random-looking pattern. An image with lots of fine detail is best. I used a marble texture from the 3DS CD-ROM converted to 640*480 and added detail with a paint program. For a background file named BACK.GIF, try: RDSGEN input.GIF output.GIF -mBACK.GIF -a4 Try one with an optional value for the horiz scan orgin (perhaps -o320) to spread the accumulated background distortion more evenly over the resultant image. It appears that RDSGEN is using only a narrow vertical strip from the background image. I haven't had time to play with this yet, but I suspect a great improvement in the background method by figuring out the exact pixel width of the strip and making a narrow, horizontally tilable GIF image for the background. ————————————————————– That's all. I hope I didn't leave out anything. There is certainly room for improvement in the above procedure. (I've only had a couple of hours of quality time with this stuff.) Please play hard and report back with any discoveries, enhancements, and better ways to do any of this. Have fun! J K J BTW, we made one image for the science teacher at the Jr High with his name in block letters, printed on the color inkjet. He hung it on the wall, and before my son got home from school he had several orders for more! PS: if anyone needs a greyscale .COL file to use and doesn't have AniPro to make one, let me know and I'll email mine – it's only 776 bytes.