News:

Welcome to RetroCoders Community

Main Menu

A spinning cube to get started

Started by ZXDunny, May 12, 2023, 12:19 AM

Previous topic - Next topic

ZXDunny

Here's a nice little demo. A while back, a friend of mine (Dean Belfield) showed off a small spinning cube that he uses to demo his hobby project systems. I converted it to SpecBAS - it uses a number of nice features already - and then enhanced it in this video. You may need to run it fullscreen to be able to read the text :)


It's a long one, 6.5 minutes, but I think it's worth a watch. Anyhow.

It uses firstly the new DIM command where you can create a pre-dimensioned array by supplying the contents as part of the DIM. See the last statements of line 20 for that. It's pretty self-explanatory and saves a ton of time that would otherwise be filled with READ and DATA statements!

The rest is standard stuff, until we get to the changes. OVER as part of any graphical output changes pixels painted based on what's already there. OVER 7 averages pixel values - with INK set to 0, the RECTANGLE command fills the area with the average of the pixels there and the colour 0 - so they effectively halve in their value. The palette is set up so that each halving is a particular colour.

The last effect is using OVER again, but with OVER 13 (which subtracts and clamps to 0 instead of overflowing) combined with INK 2. This time the palette is a smooth HSV Gradient (PALETTE HSV is used, and RAINBOW to create the smooth colour spread).

I think the result is quite nice :)

CharlieJV

I watched the video earlier on YouTube.  Totally worth watching again!