Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:06 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Moiree Demo

Author Message
NorbertJ

Newbie

Joined: 29/06/2020
Location: Germany
Posts: 6
Posted: 05:29pm 17 Jul 2020
Copy link to clipboard 
Print this post

Today I had some time time for programmimg.
I wanted to test the graphics capabilities of my new CMM2. I wrote a small graphics program based on a program in the book of Kurt Endl 'Creative computer graphics'.
When running it you are asked for a step width, I recommend 50 for the beginning...


MOIREE DEMO.zip
Edited 2020-07-18 03:48 by NorbertJ
It all started with the Elektor Junior Computer...
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 11:41pm 17 Jul 2020
Copy link to clipboard 
Print this post

Cool program! It generates some neat effects. Schön gemacht!

Here's a slight variation that 'animates' it:
cls
dim integer c(7)=(rgb(black),rgb(red),rgb(green),rgb(blue),rgb(yellow),rgb(magenta),rgb(cyan),0)

sw = 100  ' starting step width
px = MM.HRES - 10
py = MM.VRES - 10

page write 1

do
'  input "step size (1-800) (0=quit) ";sw
'  if sw = 0 then end

 cls
 i = 1
 t = timer
 for x1 = 10 to px step sw
   for x2 = 10 to px step sw
     line x1,10,x2,py,,c(i)
     i = i + 1
     if i > 5 then i = 1
   next x2
 next x1
 print @(10,0) sw "  ";
 page copy 1,0,B
 sw = sw - 1
 'pause 5000
 do : loop until timer - t > 800  ' try make constant time per step
loop until sw = 19
page write 0
end

Visit Vegipete's *Mite Library for cool programs.
 
NorbertJ

Newbie

Joined: 29/06/2020
Location: Germany
Posts: 6
Posted: 04:46am 18 Jul 2020
Copy link to clipboard 
Print this post

Thank you. Nice animation you added!

For me it is interesting how you shortened the code, especially the declaration part.
It all started with the Elektor Junior Computer...
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025