CompuServe Thread

#3DS -> RDS

20 messages in this thread
#94662From: John K. JordanMar 30, 1994 10:34 PM
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.
#94668From: Ed KellermanMar 30, 1994 11:13 PM
<I've made some SIRDS> How you been able to figure out how they work? Why they appear 3d. Ed K
#94732From: John K. JordanMar 31, 1994 10:03 AM
>>how they work… They work because the left eye is looking at one image (rather a vertical strip of it) and the right eye is looking at the adjacent image strip. The two strips are created such that the alignment of the individual corresponding dots (or pixels for a background image) makes a stereo pair and "tricks" the eye/brain connection. The method itself is very clever, simple, and confusing <g> – for one mathematical description, check out RDSGEO.TXT from lib 10 in GO GRAPHDEV. I've been playing with stereo images of and on for about 20 years now, mostly using dual images with a crossed-eye viewing technique (a headache!) I've made piles of these things by hand, drawing the interocular/object diagram to scale from the top view, measuring the offsets in the virtual images planes, and drawing the final two images by hand. Kilobaud had an article a while back (in the late '70s <g>) that gave the algorithm to create 3D lissajou (sp?) patterns (or any 3D line drawing) which could be plotted and viewed in 3D. Autodesk Autoshade would also render stereo pairs – that was good fun. The biggest problem with all the dual-image stereograms is one of scale: you need two separate images small enough for your eyes to converge into one. With SIRDS you can make BIG images! More fun, too, because of the "magic" of a picture emerging out of a noisy "nothing." I talked to my math-maniac friend today – he thinks he might be able to improve on the algorithm IF he had access to the actual 3D data rather than the simple greyscale image. Sounds like a candidate for an IPAS routine! J K J THOT for the day: what would stereo images be like if we had three eyes (in a triangle) instead of two?
#94825From: Ed KellermanMar 31, 1994 4:22 PM
<check out RDSGEO.TXT from lib 10 in GO GRAPHDEV.> Thanks! I've wanted to know how they worked for some. I didn't have to read to far, (Fig 3). Just pretend image is behind, instead of in front (crosseyed). Ed K
#94840From: ROBERT RITGERMar 31, 1994 7:01 PM
Ed: Here's some more info that I got from Colin Irwin on the GRAPHDEV forum: >>>The shuttle was rendered in Autodesk 3DS using the technique first suggested by Yoon Kit Yong of Imperial College: "If you happen to have 3D Studio, bump files can be generated by 1. Making all materials to self illum, White. 2. Define camera ranges for foreground and background 3. Define atmosphere distance cue, 0% -> 100% 4. Remove ALL light sources. Ambience to 255. 5. Render, no dithering, Phong/Metal. 6. Output to Mono TIFF Uncompressed. Try to avoid sudden changes in levels. This tends to leave outline marks and alot of further distortion on the edges." This gives you an output image which is smoothly shaded from back(black) to front(white). You can then plug this into my program which analyses the picture to look for level changes implied by changes in brightness of the source image. Although the image looks very smooth it is still banded, but the colour wallpaper and the smaller increments between bands fools you into thinking it is a continuously smooth image. I recently licensed a very large (4800×3600) SIRDS to poster manufacturers Athena International. The subject is a VW Beetle with a couple of Yin Yangs and some text thrown in for good luck. The final print dimensions are 890mmx590mm and the test print I received last week looks excellent. Once again, thanks for your comments. Col<<< Some Ed Kellerman SIRDS uploaded here would be cool hint, hint <g>. I just got that remote control watch I talked to you about. Performs perfectly at 20'! Besides operating my vcr, tv's and cable boxes it even tells time <g>. Bob
#95194From: Ed KellermanApr 2, 1994 9:21 PM
Thanks for all the additional information. Boy those things can be big! If your watch could handle X10s (Lights, AC, etc) I would get one! The biggest problem I have is losing the remote control. BTW, I've been using a CASIO watch for several years now. The "Data Bank" model. See ya. Ed K
#95300From: ROBERT RITGERApr 4, 1994 1:24 AM
Ed: I've had several 'nerd watches' from Casio. I had the Data Bank with and without the calculator. I really loved the automatic phone dialer one but I went snorkelling with it stuck to my fin and that was its last call. I had a fun April Fool's day mysteriously flipping channels at a couple of friends homes with this new one<g>. You'll be my first call when we both get two-way wrist tv's a la Dick Tracy. <G> Bob
#94678From: David StinnettMar 31, 1994 12:55 AM
John, Fun, isn't it! I stumbled across RDSgen a few months ago and made some cool stuff from 3ds. I ran into the limited grey level problem but I thought at the time it was just a limitation of RDSgen. Have you been able to get good clean 3d objects? Mine looked like the object was sliced into pieces (still looked pretty cool though). I can't remember but I probably did use GIFs. I'll have to try again using TGAs and see if it does any better. Have you considered uploading any RDS images done with 3ds along with your COL file here? David
#94731From: John K. JordanMar 31, 1994 10:02 AM
>>clean RDS… Hey David the Graphics Wonder, All of the images I've done with the random dots appear to have steps or levels along their depth. Is that what you mean by "sliced"? I've noticed a similar effect on some commercial images. Solid objects remain solid, however. The images done with a GIF background look better. One thing to watch out for: when you diverge your eyes, if you diverge TOO far and lock onto the next strip, objects in the foreground will be broken into pieces. (Another thing to try: crossed eyes give a depth-inverted image). A mathematics wizard I know is looking at the algorithms and is writing his own version – I'm waiting to see what he says about the artifacts and if he finds any limitations in the code. One consideration: I believe RDSGEN wants a specially coded image, where the red values encode the coarse resolution and the green values encode the fine resolution. The grey image may at best be a poor compromise. BTW. I get considerably less "step artifacting" when I render the source image using a custom greyscale palette. Note again that the TGA option may NOT be the best one to use. With TGAs, I think I had to both mirror the geometry before rendering AND specify depth-inversion in RDSGEN. I did think about uploading some stuff, however 1) the libraries appear to be untouchable just now, and 2) I haven't had much time to play yet and don't have anything yet that I'm especially proud of. (Some one named Stinnett set a new standard for excellence around here! <g>) J K J PS: another thing I want to do is make an RDS animation (perhaps calling RDSGEN from video post).
#94846From: David StinnettMar 31, 1994 8:16 PM
John, >>All of the images I've done with the random dots appear to have steps or levels along their depth. Is that what you mean by "sliced"? Yea. The Image I'm thinking of had maybe 20 levels. I went back and looked at the original, it's a TGA and I did have to flip it, but not invert it. One of these days when I have time I'll have to play with it some more. >>RDS animation… Now that's a cool idea! If you try it, let us know how it works (if I don't try it first). David
#94875From: Christopher MartinApr 1, 1994 12:11 AM
<RDS animation> I actually downloaded an animated RDS from the graphdev forum a while back. Can't find the name right noe, but will look for it if you are interested. Also, POPOUT allows the creation of you own RDS images and PCXAUTO produces RDSs from PCX files -FYI. Chris
#94890From: David StinnettApr 1, 1994 1:59 AM
Chris, >>I actually downloaded an animated RDS from the graphdev… Thanks. I'll go over and take a look later. David
#94706From: John K. JordanMar 31, 1994 8:18 AM
More RDSGEN stuff… I forgot to add an addendum, excerpts from a note from a very helpful fellow on the GRAPHDEV forum: ————————————————————— #: 55850 S10/3D/RDS Sources 12-Mar-94 10:29:25 Sb: #55783-3DS -> RDS Fm: Dan Richardson 72537,1341 To: JKJ (John K. Jordan) 71174,711 (X) Here's some touchup on the RDSGEN docs and source…. I don't think the docs mention that -e and -o are meaningless with algorithm 3. Use -s for algorithm 1 and -w for everyone else. Algorithm 1 provides substantially more depth at a given -f setting, although that may be a byproduct of my attempting to match up -s and -w settings. Algorithm 4 is virtually algorithm 2. I'd be interested in seeing any settings that make them produce different output. It's not quite pixel for pixel identical in my tests, but very nearly. Pixel extrapolation (-e) works quite well on gradients. When it fails, it sure fails spectacularly. It'll accept -w0, which gives you a divide by zero, and -w1, which is like -s1, meaningless. Indexing triangles (-i) are broken for -a2 and -a4. The fix is simple. Somewhere around line 476, stripw = scale >> 1; needs to be moved out of the algorithm == 3 test. I put it in an algorithm != 1 test and it looks OK. I believe the TGA in and out is screwed up, but since I always use gray GIFs for input I haven't spent any time on it. */ Have fun. — Dan Richardson Northampton, MA, US 12-Mar-94 10:02a — ————————————————————— BTW, one problem with using 3DS targas seems to be with their flavor, something to do with bottom-up versus top-down. GIFs are a lot smaller anyway. J K J
#94764From: Yost GroupMar 31, 1994 11:26 AM
You might also try RDSDRA from the same forum. It's from Germany and includes its own paint program with special features, but I found that it would load and convert any grayscale TGA file to RDS. – Jack
#95056From: John K. JordanApr 1, 1994 11:20 PM
>>might also try RDSDRA from GRAPHDEV… Jack, I did (BTW, I also found RDSDRW.LZH which has a later version of RDSDRAW) and it works fine. However, compared to RDSGEN, RDSDRAW is just a (good) toy. (With RDSGEN, you could actually set up your own booth at the mall selling these things!) The readme with the new version of RDSDRAW indicates that the author, Johannes Schmid, is working on another program, VectorRDSdraw. J K J
#95241From: Yost GroupApr 3, 1994 11:34 AM
At the time, I was looking for a toy because I needed to quickly throw together an rds for a novelty gift. I think I looked at RDSGEN and was so intimidated by the command-line interface (or lack of interface) that I quickly moved on to another program. – Jack
#94772From: ROBERT RITGERMar 31, 1994 11:56 AM
JKJ: Thanks for the pile of info. I gotta give this a serious shot. Bob
#95849From: Charles WatsonApr 7, 1994 1:11 AM
>>>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.<<< Yes please. PS. I've been using Mono Tiff and get a lot more greys, but I still get banding… what's your experience in the maximum depth (using or not using the -F option) and maximum # of levels with each method… Digitally, Charles Watson
#96341From: John K. JordanApr 9, 1994 8:32 PM
Sorry Charlie, that it took me this long to answer – I've been covered up, practically a no-sleep week. I just sent GREY.COL by email. I still got banding with it but not as bad. The best results were with a GIF as a background. I haven't had ANY time to play since the first session, so I don't have any more hints yet. I hope you come up with some and post them! I hope to get a breathing spell the last week of April, and I'll play somemore then. J K J
#96464From: Charles WatsonApr 11, 1994 12:14 AM
thanks for the .col file… I'll play with it a bit and let you know Digitally Charles