anxcon opened this issue on Jan 29, 2005 ยท 86 posts
anxcon posted Sat, 29 January 2005 at 3:11 PM
i dont know anything about python so i post here and someone else can make (if posible) in poser i have my main screen showing my scene that im creating i want to be able to have that 1 window (in 1 part, not a split window) to show 2 cameras blended together for 1 view main camera showing only red channel aux camera showing only green/blue channels so i have a realtime view (as an anaglyph) of my scene rendering every little change in camera and making them into anaglyph manually takes forever, and realtime feedback of camera changes to it would make making anaglyph pics easier and faster anaglyphs are the pictures/movies that use red/blue 3d glasses
underdog posted Sun, 30 January 2005 at 1:56 AM
Attached Link: http://www.poserpython.com/ScriptsPage.html
I think you are looking for the script on this page: http://www.poserpython.com/ScriptsPage.html It's called "DualCamera.." Is that what you wanted?anxcon posted Sun, 30 January 2005 at 5:57 PM
no not quite that script is like 90% right but instead of the 2 pics left and right, i need 1 pic main camera showing only red channel aux camera showing only green/blue channels on ONE picture, NOT split :) see what i need now? if i have to i can make a pic in poser+psp n show o_o
ockham posted Mon, 31 January 2005 at 4:27 PM
If you're on Windows, I can do it. (The solution requires an external piece of code that only works on Windows.) Show a picture of how you want it....
anxcon posted Tue, 01 February 2005 at 12:15 AM

underdog posted Fri, 04 February 2005 at 5:39 PM
I am not sure how to combine these colors. Did you need this on Windows? I would like to see something like this, Ockham, if you are still interested in writing it. If you want to generate random dot stereograms from poser files, that would be cool too. But only if you really want to. :-D
ockham posted Fri, 04 February 2005 at 9:58 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph.zip
Here it is if you want to try it. It's not as automatic as Anxcon wanted, but it does give the desired combination. Warning: It's strictly Windows! (Relies on an external piece of C code, in the Win API)ockham posted Fri, 04 February 2005 at 10:00 PM
The combining action is not done in Win GDI; it's just a file operation. So it could be written in straight Python, but would be somewhat slower (I think.)
underdog posted Fri, 04 February 2005 at 10:40 PM
I would be interested in seeing that 'c' code if you want to post it. As for me, I am off to try it and dig out my red blue glasses..
But.. before I go.. a story..
I am kind of old. Perhaps not the oldest on here, but I was one of the first people in St Louis to own a Commodore Amiga 1000 back in November of 1985. A couple of years (or so) later, a friend of mine from the user-group got some Haitex 3D shutter glasses.
WAY KEWL. We took my video camera, set it on a tripod, and grabbed some stuff to shoot. A clay skull that I made in highschool, an old cap-gun from silver dollar city that looked like it was from the 1800's, a decorative treasure-box, some costume jewelry... it looked like pirates treasure.. Then we pointed the camera at it, shot a frame, move the camera a few inches ("there, that outta be enough...") and shot another frame.
...when we put it into the Amiga... MAGIC.
It really looked like my Amiga monitor was a "carpeted box" with the skull, gun, glass beads, etc, sitting inside.. Yet you could still see the pixels.. hard to explain how magical it seemed..
To this day I still can't figure out why 3D LCD shutter glasses aren't popular. Ah well. Off to try that code.
===Underdog===
ockham posted Fri, 04 February 2005 at 10:51 PM

underdog posted Fri, 04 February 2005 at 11:15 PM
thanks! btw.. that install didn't work out right. I had to create the camfade directory. The ZIP file has this path...
Runtime/Python/poserScripts/Anaglyph
...but the scrypt is looking for this path...
Runtime/Python/poserScripts/camfade/Outputs
It can create one level of directory (Outputs) but not two levels (camfade/Outputs)..
Once I got that figured out, I realized that the "Render()" calls were commented out. Then I had to move the 2nd DrawAll() call so it took place before the render call (the Aux camera was saving the 'display' view).
Now I get the BMP files created with red-blue mixed...
...but! there is still a problem I can't fix. The displayed image isn't showing up in the dialog box. It does create the BMP file and I think it looks pretty good. I can't find my damned 3d glasses! Any of them (h'yuck h'yuck!)... My kids absconded with them, curse their black little souls ... just kidding.
Anyway, I am off to search some more for 3D goggles.. Last time I had to hand make some.. but that is another long story..
===Underdog===
ockham posted Fri, 04 February 2005 at 11:21 PM
OOps, I'll correct the path and repost. The Render() calls were removed for speed, because Anxcon wanted something that was close to immediate. I'll set up two versions, one with and one without.
ockham posted Fri, 04 February 2005 at 11:29 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph.zip
Okay, that's done. Same link as before. I'm anxiously awaiting your judgment on the image itself, because I don't have any idea what it should look like. I suspect the mixing needs to be done in a fancier way, not just by ORing the pixels....underdog posted Sat, 05 February 2005 at 12:58 AM
I hope you weren't waiting for MY judgement as I am apparently no longer in possession of red-blue glasses. I will look more tomorrow... I guess we have to wait for anxcon to respond to this. I was busy trying to convert Mix to python and realizing that I don't know how to read and write binary data in python. Let alone then display the image once it is written to a file! IIRC, I can't do that? I know Perl really well, and I am always struggling with what I find to be difficult documentation for Python. But that is probably just me. Lots of folks love that language...
anxcon posted Sat, 05 February 2005 at 1:18 AM
ok sorry if i actin like a critic, especially since i cant do any of this myself :) just trying to guide it to perfection :) ok looks like its on almost right track (btw used unmoved V3 as a test to look) but when i look at the image created (without glasses, and with) i see it mostly straight, but some areas are a bit grainy kinda and window showing pic is same size no matter poser window size so that look might be the result of resizing imagine down? (since my poser window is much larger than the anaglyph window) but as for showing the colors channels together, looks right posible have output window follow posers window size? so both show exact same size pics, if posible current one too small for me :) 27 inch monitor next when i click on "show" i get alot of lag suddenly while the files are saved and loaded from my harddive is it posible to leave entire process in ram? and while the "show" button helps speed up the whole testing angles alot (this idea will kill my comp tho if the pictures arent totally handled in ram), a "Live" button to cause the window to do live updates, and work more like poser main window does, would add both speed and even better end pics assuming you can get above 2 ideas to work, i noticed the window doesnt show while im changing a dial for camera is there a way for the window to stay on top always? if so, add a "always on top" button the live part would require it, while other parts it would cause more annoyance than good, so ya button :) umm should probably shut up now :) just tryin be thorough if above stuff is done, ill add more input maybe lol thanks :)
underdog posted Sat, 05 February 2005 at 1:34 AM
heh heh heh.. I am still waiting for the random dot stereograms!! (just kidding)
anyway.. I wonder if setting your output window in the animation properties would change the render window size? either there or the render options..
try changing either..
"Animation->Animation Setup"
or..
"Render->Render Options"
...and see if that changes your output window size.
Also, FYI.. I think you are going to run into problems with the way Poser handles interactivity really soon now. Poser doesn't do the "remain on top and still let me click the camera" stuff very well if at ALL.. Just a sad but true fact.
I am out of my depth on this stuff, so I can't help. I can nit-pick some directory issues and then I pretty much have to step aside. I can tell you that saving to RAM instead of disk seems unlikely. The problem is that Poser only lets you do certain things, and if they aren't there.. well it's pretty tough if even possible to do them.
For example.. wouldn't you think it would be easy to create an AVI (movie) file using Poser python? It's NOT. You can create sequences of images, and you can create a flash movie (SWF), but you can't create an AVI. It isn't supported by the poser library.
So buffering images in RAM is pretty tough. But it doesn't hurt to ask, eh?
underdog posted Sat, 05 February 2005 at 1:43 AM
BTW, ockham, looking at that 'c' code for the bitmap manipulation: shouldn't you be doing an 'fseek()' on the GrnFile for 36 bytes after reading the header from RedFile? If not, won't GrnFile be off by 36 bytes?
underdog posted Sat, 05 February 2005 at 1:46 AM
Oh and anxcon, I am wrong about the Render Options / Animation Setup stuff. That preview window is hardcoded in the python script. You might be able to change the number. You can definately find the "out.BMP" file and see what it looks like at full resolution. That file is in.. .../Runtime/Python/poserScripts/Anaglyph/Outputs/out.BMP
anxcon posted Sat, 05 February 2005 at 2:37 AM

anxcon posted Sat, 05 February 2005 at 3:11 AM
o another thought if you cant have the "always on top" part for the window while clicking cam controls, then what about on the window, have 2 arrows, right and left, a click changes X orbit of Aux came by +/- 0.1 degrees, or a box to enter amount that each click effects it then a number is also displayed showing value of X orbit Aux - Main = # (ie 23.4 - 21 = 2.4) and posibly when script is first started, Aux cam copies all stats from main cam and changes X orbit to Main +2 (default startup)
ockham posted Sat, 05 February 2005 at 8:26 AM
Okay, I'm awake again. Sort of. Underdog: Thanks for the fseek catch! That was exactly why the pictures were unsynchronized. Anxcon: I can certainly do the Main/Aux action as you describe; but shouldn't it be Y orbit instead of X orbit?
ockham posted Sat, 05 February 2005 at 8:52 AM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph.zip
Made those two changes, using Y orbit. Try it now.....ockham posted Sat, 05 February 2005 at 8:54 AM

underdog posted Sat, 05 February 2005 at 11:37 AM
I gotta say, Ockham: I sure hope you are stinkin' rich from whatever you do as your "day job". All of this free help is wonderful. Everyone already knows this, but it doesn't hurt repeating it..
All Right Then. This weekend I really HAVE to get that Poser Python Script Archive working.
I put a few hours into the upload page this last week, and I almost have it ready, but I am still trying to get the organization of the catalog right once the files are uploaded.
Anyone reading this want to suggest categories for Poser Python scripts? Message edited on: 02/05/2005 11:45
ockham posted Sat, 05 February 2005 at 2:24 PM
I'm happy you're serving as Editor or Beta for these. Seems like I'm missing a lot of details in the last week or so. This seems to happen about twice a year; means it's time for a break from programming to defrag the old "wet RAM". -------- Some categories that seem likely: Lights Camera Textures Morph and magnet organizers Animation helpers (Naturalizer, randomizers) Multiple prop / Multiple figure control Sound and music Render control File organizers (Extractors)
anxcon posted Sat, 05 February 2005 at 2:46 PM
i installed the recent files and used even tried reinstall 4 times but its acting like no last version like no changes were made -.- ill fiddle with it little more and be back in a few
ockham posted Sat, 05 February 2005 at 2:55 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph3.zip
Sometimes my stupid web-server doesn't change to the new version when I use the same name. (Some sort of "caching".)Try this link with a different version name.
Also, be sure to install "manually" by extracting the
files into a temp folder, then moving to Poser area.
Message edited on: 02/05/2005 15:04
ockham posted Sat, 05 February 2005 at 3:04 PM
Note the switch to 3 in the link above, not 2. Last minute correction!
anxcon posted Sat, 05 February 2005 at 3:12 PM
i always install manually :) brb testing
ockham posted Sat, 05 February 2005 at 3:39 PM
Python Powered Props. Could also be called Kits.... a prop or figure that uses a custom script to run itself, or a script that is tied to a custom set of "stock" props like my Weather kit.
anxcon posted Sat, 05 February 2005 at 3:53 PM

anxcon posted Sat, 05 February 2005 at 4:25 PM
so "enter" key sets the value*
ockham posted Sat, 05 February 2005 at 4:36 PM

underdog posted Sat, 05 February 2005 at 4:46 PM
I wouldn't worry too much about the beta stuff ockham. I sure as hell don't want anyone to hold my feet to the fire for a wrong directory name and stuff like that. If they do, they can find their free stuff elsewhere, fur shure. You just keep crankin' them out and I will try to keep you honest from time to time. :-D ===Underdog===
anxcon posted Sat, 05 February 2005 at 5:16 PM
_anaglyphmodule15 62,464 bytes 2/5/05 6:17 AM _anaglyphmodule22 65,536 bytes 2/5/05 6:18 PM both of those came with the zip and are in dll folder
ockham posted Sat, 05 February 2005 at 5:23 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph4.zip
Yup, those are the latest PYDs. I wonder if your Poser is set to produce a different format of BMP, that my Mix code doesn't agree with? Here's a revision that seems to run faster, and includes your Enter-the-aux idea.anxcon posted Sat, 05 February 2005 at 5:45 PM
as for the aux cam coords, 3 options 1) show the "difference" in degrees (my prefered way) 2) show both main and aux yorbit 3) show "center point" and a 2nd window shows "+/- #" meaning main is center - # and aux is center + # but you would have to change the arrow keys to effect main and aux yorbit when clicked, so center stays same id take option 1 or 3, 3 is accually lil nicer but then it effects main camera, when i use that to do things so option 1 is best, but your choice to add others ill test latest update :)
anxcon posted Sat, 05 February 2005 at 9:26 PM
no ideas for the line problem, you on pc or mac? me pc does your code care the poser window size? perhaps some resizing is going on somewhere? Out looks same size as the window in poser tho, so thats straight
ockham posted Sat, 05 February 2005 at 9:38 PM
It shouldn't be affected by the display size. The mix action just reads two BMP files, skips the header part, then combines the pixels one by one, with red from the Main (RED.BMP) and green and blue from the Aux (GRN.BMP) Red file...r.g.b.r.g.b.r.g.b Grn file...R.G.B.R.G.B.R.G.B Out file...r.G.B.r.G.B.r.G.B It's all PC; if you were on Mac, it wouldn't even begin to work.
ockham posted Sat, 05 February 2005 at 9:42 PM
The only way this could fail is if your BMP files don't follow this same format. I thought all Poser BMPs used the same format, but maybe not.... Could you ZIP up one of your RED.BMP files and send it to me? Posting it here won't help; no telling what the net does to an image. email occam24@aol.com
underdog posted Sat, 05 February 2005 at 10:53 PM
uh. I posted the same idea and then finally READ what ockham had already suggested. oops.. :)
Message edited on: 02/05/2005 22:56
underdog posted Sat, 05 February 2005 at 11:12 PM
Attached Link: http://www.fantasy3d.com/pfiles/python/Anaglyph4B.zip
With Ockham's permission, I have modified the AnaglyphRender.py script in two ways. The link will send you the entire archive again with the updated file in it.I changed it to not render images until you click the Show button. I also added a mouse click event to START the Out.BMP file with whatever you have associated with the BMP suffix on your box.
Feedback is appreciated!
anxcon posted Sun, 06 February 2005 at 2:04 AM
"Could you ZIP up one of your RED.BMP files and send it to me? Posting it here won't help; no telling what the net does to an image." forum doesnt accept bmp anyways :) had to convert to jpg sent you red/grn/out hope you dont mind the model :) just the project i saved for testing the script lol also a new addition to the cam controls have it so when you change yorbit on aux cam it cant go any less than yorbit of main cam cuz the anaglyph work by having right/left pics its not really needed, just an "idiot proof" feature lol as for my bmp format, i didnt know was different kinds of bmp :S have fun :)
ockham posted Sun, 06 February 2005 at 11:56 AM
OK, I'll put in the leftward limit. Makes sense. Analyzing the BMPs now; they appear to be the same format, so that's not the problem. There are different BMP types, for 2-color, 256-color, and 'palette' vs 'RGB' true color. It didn't seem likely that Poser would use different types on different computers, but Poser is full of mysteries, and I wanted to be sure.
ockham posted Sun, 06 February 2005 at 12:04 PM

anxcon posted Sun, 06 February 2005 at 12:18 PM
oooooooooo ya
i kinda knew that color thing from like 10 years ago
dunno why it didnt pop in before :S
sits and awaits next update dont forget underdog's files :P i posted same time as you :S glad ya found it :D this could be best plugin ever ya know :D
Message edited on: 02/06/2005 12:20
ockham posted Sun, 06 February 2005 at 2:09 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph5.zip
See if this is any better. It looks better on my computer in large size, but that doesn't necessarily mean anything. Reinstall the whole thing, because I changed the PYD files as well. Also included the left-limit and Underdog's click-to-show.ockham posted Sun, 06 February 2005 at 2:41 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph6.zip
Added an Animate button, so when you've found the right setting you can automatically mix all frames, with outputs in the standard form like Image_0001.BMP, Image_0002.bmp,,,, Of course, the animation is done in Preview mode in AnaglyphPreview.py, and in Render mode in the other script.Message edited on: 02/06/2005 14:43
anxcon posted Sun, 06 February 2005 at 3:06 PM
brb testing ^_^
anxcon posted Sun, 06 February 2005 at 3:11 PM
nope still the same mixing problem for me perhaps tell the window size you are using? i can test at that size and see if it works :)
ockham posted Sun, 06 February 2005 at 3:18 PM
Hmm. My standard size is around 400 x 400.
anxcon posted Sun, 06 February 2005 at 3:18 PM
perhaps its the way it mixes them? cuz the Red and Grn are writen, they look fine like poser window then its just the Out file that isnt right maybe a typo in read/write code?
underdog posted Sun, 06 February 2005 at 3:39 PM
Hey ockham, would you please send the 'c' source to me again? or include it in the zip? I was wondering if I would see anything. I am off to test version 6 myself.
ockham posted Sun, 06 February 2005 at 4:03 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph7.zip
Anxcon, are you sure you've installed the latest PYD's? When I set the doc window to 540 x 540, which is about as large as it can go, the result looks good now. Here's another random change anyway.......underdog posted Sun, 06 February 2005 at 4:59 PM
argh.. I looked everywhere and I can't find any 3d red-blue (or is it red-green) glasses.. I found some sheets of colored plastic from an ancient project of mine and I might be able to construct some, but I am not sure I have the colors right. The red plastic sheet I have filters OK (I can't see the ghost red) but the blue / green does not (I can still see both ghost images). I am not getting (much) 3D effect. Which eye should be RED and which should be BLUE? The AnaglyphRender.py was set to display not render (I had to uncomment it). It does a double render each time I clicked the adjust angle. Hmm..
ockham posted Sun, 06 February 2005 at 5:04 PM
The latest zip does include the C source, incidentally. On my computer, adding the #pragma pack(1) to the rgb struct seemed to make a difference. ????
anxcon posted Sun, 06 February 2005 at 5:34 PM
set my poser window to 400x and 500x and still same result i wouldnt think that it as anything to do with my video drivers would it? doesnt seem to matter my poser window size and yes i installed them right :( underdog, theres places on net you can get 3d glasses free well costs you 2 stamps (37 cent per in US) you can get a pair sent back to ya :) just look on net you'll want red/cyan glasses, cyan is blue+green in 1 its like a light blue, tht shows anaglyphs (as long as they were created for it) to show in much better color and red goes over left eye also another addition if you feel like it (if script works for others may as well continue to make it better, or wait till works for me lol) but set radio buttons in it (select one and it unselects rest) and give following 1) red/blue 2) red/green 3) red/cyan (blue+green) there is also black/white anaglyphs but forgot how the color channels are used for making them, they still have red/cyan ghosts, but main part shows b/w, but i guess skip that till found how to make just an idea for sometime =S
ockham posted Sun, 06 February 2005 at 6:01 PM
Unless Underdog can find the problem in my mixing code, I'll just have to bite the bullet and use a much more complicated form of mixing. (Using the BitBlt actions within Windows.) Judging from experience with similar tasks, it will run slower than the current method, but it will also less sensitive to file-format.
underdog posted Sun, 06 February 2005 at 6:13 PM
I haven't opened up the source yet. You will need to give me some time on that. I don't have a compiler installed and haven't compiled in 'C' on a windows box in about 5 or 10 years (literally).. I have on unix but that doesn't count :) Can I download a compiler somewhere or do I have to use the microsoft visual c (or whatever they are calling it).. assuming I wanted to compile this. Let me see if I can glean anything else from the code. I hate to resort to bit-blit just yet.. But I think that having a 3d mode in Poser output would be way cool. I have some shutter glasses (... WIRELESS! now that's an improvement over the Amiga days!) that I can dig up.. Anxcon, thanks for the red-blue glasses tips. I will perservere.. I hate waiting for snail mail. I wish I could buy them at a grocery store. but sadly, most folks think they are not a commodity.
underdog posted Sun, 06 February 2005 at 6:21 PM
The source code looks fine to me. I am focusing on the Mix function for two reasons. First, the rest is over my head. Second, Mix is either generating a good BMP file for "Out.BMP" or it is not. The display on the Tk dialog box is secondary at the moment. If the large image looks ok, then we worry about the Tk dialog. Make sense? So: Anxcon, are the BMP files jacked up? Would you please send one to me at my underdog account at fantasy3d.com? Please send me a Red.bmp, Grn.bmp and Out.BMP so that I can see how they are being incorrectly combined. Yes, I realize you have already done this for Ockham, but as Eric Raymond (?) says, bugs don't last long with 1000's of eyes are looking at them (or pairs of eyes in this case). ===Underdog===
anxcon posted Sun, 06 February 2005 at 6:22 PM
comic stores also usually have them and spy kids 3d left movies stores with a ton you could try there as well
underdog posted Sun, 06 February 2005 at 6:26 PM
actually, it was spy-kids 3d that forced me to make a couple pair the last time! we rented the 2 disk dvd from blockbuster only to discover that there were no glasses in the case. When I called the local blockbuster, they said, yeah, none came with it! I was not amused and pretty suspicious, but the only choice was to return the dvd or... make some glasses. So I did plan 'B' and it worked out fine. But now they are gone, alas..
anxcon posted Sun, 06 February 2005 at 7:59 PM
sent pics to underdog
underdog posted Sun, 06 February 2005 at 9:27 PM
Hi Ockham and Anx Con..
I got the pics. Not much to report. The merged pic is clearly corrupted, but in an odd way. I zoomed in on the Aux Camera / Main Camera overlay and that shows pixel variations in places where we should see identical colors (in other words, where one set of letters is printed on a solid color without overlap from the other set of letters), but instead the pixels seem to alternate colors in a pattern.
Researching the BMP file format on the web, it looks to me like the file header on an uncompressed BMP file should be 54 bytes, not 36 bytes. Maybe this is corrupting things. Ockham, tell me if you agree after checking this link?
http://www.daubnet.com/formats/BMP.html
I assume the layout is valid.. Doesn't it seem to indicate that the raster data starts after the 54th byte?
<br></br>Header 14 bytes Windows Structure: BITMAPFILEHEADER <br></br><br></br> Signature 2 bytes 'BM' <br></br> FileSize 4 bytes File size in bytes <br></br> reserved 4 bytes unused (=0) <br></br> DataOffset 4 bytes File offset to Raster Data <br></br><br></br>InfoHeader 40 bytes Windows Structure: BITMAPINFOHEADER <br></br><br></br> Size 4 bytes Size of InfoHeader =40 <br></br> Width 4 bytes Bitmap Width <br></br> Height 4 bytes Bitmap Height <br></br> Planes 2 bytes Number of Planes (=1) <br></br> BitCount 2 bytes Bits per Pixel <br></br><br></br> 1 = monochrome palette. NumColors = 1 <br></br> 4 = 4bit palletized. NumColors = 16 <br></br> 8 = 8bit palletized. NumColors = 256 <br></br> 16 = 16bit RGB. NumColors = 65536 (?) <br></br> 24 = 24bit RGB. NumColors = 16M <br></br><br></br> Compression 4 bytes Type of Compression <br></br><br></br> 0 = BI_RGB no compression <br></br> 1 = BI_RLE8 8bit RLE encoding <br></br> 2 = BI_RLE4 4bit RLE encoding <br></br><br></br> ImageSize 4 bytes (compressed) Size of Image <br></br> It is valid to set this =0 if Compression = 0 <br></br> XpixelsPerM 4 bytes horizontal resolution: Pixels/meter <br></br> YpixelsPerM 4 bytes vertical resolution: Pixels/meter <br></br> ColorsUsed 4 bytes Number of actually used colors <br></br> ColorsImportant 4 bytes Number of important colors 0 = all
===Underdog===
underdog posted Sun, 06 February 2005 at 9:32 PM
Ah Hah! I just realized that 36 hex == 54 decimal.. coincidence? Expiring minds want to know!
underdog posted Sun, 06 February 2005 at 9:39 PM
I also read this (sorry for the short, scattershot posts)..
Raster Data encoding for 24bit / truecolor images<br></br>BitCount = 24 Compression = 0<br></br><br></br>Every 4bytes / 32bit holds 1 pixel. The first holds its<br></br>red, the second its green, and the third its blue<br></br>intensity. The fourth byte is reserved and should be zero.<br></br>There are no color table entries. The pixels are no color<br></br>table pointers. No zero padding necessary.
If I understood the code correctly (notice that "if" at the beginning of this line), I think you are pulling 3 bytes at a time for each pixel (r,g,b), and not skipping the 4th (reserved) byte... If so, doesn't this mean that something's got to go wrong?
The problem I am having with this is that it would seem that something would go wrong RIGHT AWAY and stay wrong!! I would think that the picture would end up being pretty strange looking. So, I must be missing something with this one, but I thought I should mention it.
ockham posted Sun, 06 February 2005 at 11:35 PM
Attached Link: http://ockhamsbungalow.com/PPP/Anaglyph8.zip

underdog posted Sun, 06 February 2005 at 11:39 PM
There are 10 types of people in the world. Those that understand binary and those that don't. :-D
I gotta get to bed soon, but I will download it and give it a try first.
Culater. Oh and did you see that part about using all 32bits for each pixel rather than 24bits? are you reading in 3 bytes or 4 each pixel?
Message edited on: 02/06/2005 23:40
ockham posted Sun, 06 February 2005 at 11:40 PM
As for the four bytes versus three bytes, that is a valid difference, which I did try both ways at an earlier point in writing this. But it's clear from the above view that Poser uses straight 3-byte coding in the BMPs it writes. I was actually writing this mix process for an all-in-Poser camera cutter and fader script, so I just used it here because it was similar. The camera fader was in fact suffering from a similar mysterious lack of sync, which can now be solved thanks to your catch!
underdog posted Mon, 07 February 2005 at 12:25 AM
I did a bit of investigation, and I agree that 3 bytes per pixel seems to be the rule, not 4. I did this using photoshop, not poser, but even there an uncompressed 24 bit image seems to be in a different format than what I find documented on the web.

The screenshot is a hex dump of a 10x1 pixel BMP with alternating white and black pixels. This BMP shows me that we have FF FF FF 00 00 00 FF FF FF 00 00 00 repeating patterns.. Hmmm..
There's one (small) thing that may be wrong..

This is a super zoomed in screenshot of the upper left corner of the combined image. I wonder if the colors are correct. I put this on a black background (pixels = 0x00 0x00 0x00). The camera names are solid white (0xFF 0xFF 0xFF).
In a perfect world (which I realize red-blue filters ain't) we would see a white Main Camera through one eye and a white Aux Camera through the other eye. They would both appear "white". Now I know they can't be white, but is something close to that happening? I am without red-blue glasses, as I have droned on endlessly about already..
anxcon posted Mon, 07 February 2005 at 12:31 AM
hmm......... k 1st, i deleted and reinstalled the scripts i know i got correct files in tried preview script, and still has same problem (as if no change) tried the render script (thought you added part so doesnt render until "show" is clicked? its instant render still) forgot to mention says a window with the msg, not found E:Profile FilesPoser 5RuntimePythonposerScriptsAnaglyphAnaglyphRender.py but still triggers the rendering and makes a pic like preview and still same line problem should i just kill my comp? lol
ockham posted Mon, 07 February 2005 at 12:33 AM
Yes, I've been wondering about the colors as well. The problem is even worse in the cam-fade mixing. I haven't found any good documentation on the best method for a "convincing" colormix at the pixel level. This may be more of a perceptual thing than a strictly programming/math thing. Would the eye do better with alternating scan lines instead of OR'ing each pixel? Guess we'll have to wait for Anxcon to apply the goggles.... Think I'll order a pair just to join the fun, though.
ockham posted Mon, 07 February 2005 at 12:42 AM
It's bedtime for me. Maybe you should delete everything related to this, including folders, and re-install from latest link? After so many revisions, old versions can get tucked into places where you may not realize.
underdog posted Mon, 07 February 2005 at 12:48 AM
yes, I agree, and I am past my bedtime too. anxcon, be sure you have REMOVED these files and then reinstall: ...RuntimePythonDLLs_Anaglyphmodule15.pyd ...RuntimePythonDLLs_Anaglyphmodule22.pyd And you are right about the code reverting back on the show button, etc. We can tweak how the buttons work after we get the images right. Those two pyd files are were the action is. Be sure they are dead. You might make sure Poser is closed too, in case it keeps them in memory or something. Hell, even a reboot isn't out of the question, considering it's windows. One concern I have is that I am doing all of this on P4 and so is Ockham, I think. But that really should not matter in this case. I think. :)
ockham posted Mon, 07 February 2005 at 12:52 AM
To remove the startup render, just find line 93 in AnaglyphRender.py and delete it. Line looks like this: self.Action() # Show once And yes, I'm mostly using P4 because P5 is just so slow, but I'm testing some steps in P5.
anxcon posted Mon, 07 February 2005 at 12:53 AM
ill format my drive and test a new
as for the color mixing underdog shows
thats a green+red=yellow-aux/blue-main
my guess is just out of phase selection of colors
try switching the points the script uses as blue and red
should show as red/cyan(light blue) ghosts
whereas underdog shows blue/yellow
i dont need glasses for that :)
i dont get to goto bed for another 3 hours ): PST time sucks ill finish this before i go and leave the results tho :)
Message edited on: 02/07/2005 00:56
underdog posted Mon, 07 February 2005 at 12:57 AM

Ockham: I don't think that removing the Action method in the main program will work. I am pretty sure I tried that, but there are side effects like you need the camera parameters that Action uses or something.. IIRC, I had to create a separate subroutine to initialize the camera.. It also needed to be done for the left and right buttons... But maybe the code has changed or I missed something.
(and btw, I thought you were going to bed?)
ockham posted Mon, 07 February 2005 at 12:57 AM
No, no, don't format your drive! Hope you're just kidding about that. Just be sure those PYD files are fully gone, then re-install.
ockham posted Mon, 07 February 2005 at 12:59 AM
Re the Action: Ok, that makes sense. I'll handle that in the morning when I'm (comparatively) fresh.
underdog posted Mon, 07 February 2005 at 1:09 AM

This script replaces AnaglyphRender.py and I will post a similar one for AnaglyphPreview.py in just a sec..
Then I swear-ta-god I am going to bed. And btw, ockham, if you disagree with any of these tweaks, you won't hurt my feelings by telling me.
underdog posted Mon, 07 February 2005 at 1:12 AM

anxcon posted Mon, 07 February 2005 at 1:37 AM
the format thing yes accually was serious =P i have 4 drives, system/archive/programs/programs last 2 are basicly same, been testing on both have 2 poser installed incase 1 drive dies but anyways archive drive has backup of everything basicly i can format and copy back in 10 minutes max which i just did to 1 drive lol no biggy to me have that setup cuz popups on websites kill me :S (dont comment) anyways back to script started clean and same problem but i looked at picture up close tryin to help more Out.bmp is showing like line 1 red line 2 green line 3 blue line 4 red not all like that, its just the "ghost" parts mainly where ghost shouldve been red/cyan also i running v5.0.0.229 for poser 5 perhaps im out of date or something? will look for updates cant think of much else, also tired lol
anxcon posted Mon, 07 February 2005 at 2:44 AM
scratch the version update for me, did nothing this thread is getting long ^_^
underdog posted Mon, 07 February 2005 at 7:05 AM
Ockham, I recommend you rename the DLLs just to be sure anxcon isn't somehow picking up old ones. Yeah I know it doesn't sound like it, but that drives a stake through the heart of that issue and we don't have to worry about it anymore.
I haven't tested yet on P5. I have a day-job so I won't do that until about 6 or later CST. But I can't understand why a P5 24-bit BMP image is different from a P4 24-bit BMP image... Hmmmm...
Anxcon: Are you saying that you COMPLETELY REMOVED all instances of your Poser 5 installation?? Wow.
Maybe we should switch to a new thread?
Message edited on: 02/07/2005 07:09
ockham posted Mon, 07 February 2005 at 8:42 AM
Anxcon: Your Poser 5 isn't the latest. I have 5.0.4.321 . Earlier versions of P5 did have big problems in rendering, which included some scan-line oddities IIRC. That may not be the problem here, but you should certainly update for general purposes anyway!
ockham posted Mon, 07 February 2005 at 8:42 AM
And I'll start a new thread. This one is almost as long as the 3-year-old Wish List thread!