PSET "hat" graphic from old ad in BYTE - Printable Version +- QB64 Phoenix Edition (https://staging.qb64phoenix.com) +-- Forum: QB64 Rising (https://staging.qb64phoenix.com/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://staging.qb64phoenix.com/forumdisplay.php?fid=3) +---- Forum: Programs (https://staging.qb64phoenix.com/forumdisplay.php?fid=7) +---- Thread: PSET "hat" graphic from old ad in BYTE (/showthread.php?tid=202) |
RE: PSET "hat" graphic from old ad in BYTE - dcromley - 04-30-2022 So this post will give the almost-original "PSET hat" drawing from an ad by Micro Technology Unlimited in Compute magazines of 1981. The ad was for a Commodore PET upgrade to hi-res (320x200!). The code has been modified to run under QB64, slowed down, and made able to be paused. @CharlieJV got the key link to the thread ( https://atariage.com/forums/topic/218503-graphics-8-fedora-hat/#comments ) where Atari fans are running it -- on Ataris and many other old computers! A lot of talk there how to speed it up. We have to slow it down. It's a BIG thread, but no mention of an author. It was and is still stunning how such a few lines of code can create a complex drawing and even take care of hidden lines. Here is a little info on the workings of the program (the programmer was working with a BASIC with 2-character name restrictions!). I can understand only some of the code. The hidden points in back are hidden by erasing them as the nearer points are drawn. I did plot the math function they used: Plug this function into my "FunctionPlot" program ( https://staging.qb64phoenix.com/showthread.php?tid=260 ). Code: (Select All) Function func1 (x) Imagine the curve between the blue lines, rotated around the center -- it would look like a hat! You can replace this one line in the original code and a get a different hat -- a dunce hat. Code: (Select All) 'Replace this: The almost-original code: ( @bplus - obviously I've spent too much time on this ) Code: (Select All) ' From Compute Magazine, 11/1/1981 That Atari thread had another version, that drew front-to-back instead of back-to-front. To do that and take care of hidden points, an array(320) holds the y values drawn so far, and any point lower is not drawn. Here is that code, from the same thread. Code: (Select All) ' The "hat" - Front-to-back processing I could spend time on using that technique on a large screen, but I would rather study OpenGL. With OpenGL, you (you) can create the surface in 3D and then move it and rotate it. A great start into QB64 OpenGL is https://ashishkingdom.github.io/OpenGL-Tutorials/intro/ . It covers basics, points, lines, triangles (key to all surfaces), circles, colors, textures, 2D translations, [oops, stop]. Very well done, but doesn't make it to 3D translations and 2D and 3D rotations, lights, cameras, etc. I will be asking how to get further into this. RE: PSET "hat" graphic from old ad in BYTE - bplus - 04-30-2022 Hi @dcromley Here is another mod by b+ Code: (Select All) _Title "Hat - b+ mod of dcromley's port from atari" ' 2022-04-30 I messed up color, need to get z involved and bigger multiplier than 1 for fraction of screen x, y is at. I leave that to another needing to kill time ;-)) I had fun with this thanks, thumbs up to you! RE: PSET "hat" graphic from old ad in BYTE - dcromley - 04-30-2022 Quote:@bplus : .. messed up color ..An entirely different texture! Interesting. Got to look again/more. Tnx. RE: PSET "hat" graphic from old ad in BYTE - mnrvovrfc - 07-27-2022 https://en.wikipedia.org/wiki/Yabasic#Yabasic_example Actually edited it for QB64 and used _PUTIMAGE to make the screen twice as large. RE: PSET "hat" graphic from old ad in BYTE - CharlieJV - 08-11-2022 A little extra related reading material from 1982: https://archive.org/details/analog-computing-magazine-07/page/n61/mode/2up RE: PSET "hat" graphic from old ad in BYTE - dcromley - 08-11-2022 @CharlieJV Neat find from 1982! Thanks. Will process it. |