Murga-Projects Forums
FLTK Graphics Functions - Printable Version

+- Murga-Projects Forums (http://www.murga-projects.com/forum)
+-- Forum: Project Forums (/forumdisplay.php?fid=1)
+--- Forum: MurgaLua - General (/forumdisplay.php?fid=2)
+--- Thread: FLTK Graphics Functions (/showthread.php?tid=66)


FLTK Graphics Functions - iGame3D - 06-29-2007 04:12 PM

Here's a demo of the FLTK Graphics Functions.

The program draws concentric rings using the mouse as an origin
It cycles through the colors continously.
While the mouse is down it will switch tools, switching until the mouse is up.

The variables have very interesting effects, someday I'll get around to a
UI for them, for now here's the psychedelic murga brush.


RE: FLTK Graphics Functions - mikshaw - 06-30-2007 12:52 AM

How delightfully obnoxious =o)

I added this to the end, just above the callback loop, to control the background color and fullscreen from the commandline:

Code:
for i=1,table.getn(arg) do
if arg[i] == "-f" then w:fullscreen() end
if arg[i] == "-c" then w:color(arg[i+1]) end
end


I wonder if you wrote this on Mac and then made a change or two on Windows? It's apparently in Unix format, but the doTools_circles function contains several DOS line breaks (^M). They don't cause trouble, but I just thought it was interesting.


RE: FLTK Graphics Functions - iGame3D - 06-30-2007 08:22 AM

oh full screen is fun, thanks for that, going to keep that handy!

I've been very side tracked hacking the ascii text out of my first computer, the Mattel Aquarius.

Programming Microsoft BASIC 1.0 with   Virtual Aquariusby emulating Windows with Crossover.

Lots of back and forth between windows/unix/mac.

I was having fun with iGame3D's text features a few weeks ago
and decided to relive some old school BASIC coding by printing
game characters to the screen.

The running man was the first program I wrote on my Aquarius on Christmas morning 1983.

So I brought him to iGame3D with his friend using Fluid to
build the whole script and a little interface intended to manipulate the
text. Here's a movie of the that

Now this all ties into this thread because, the program I hacked
on the Aquarius about a bazillion times is this:

Code:
REM this is MS BASIC 1.0 1983
5 PRINT CHR$(11)
10 PI=3.14159
20 FOR J=30 TO 2 STEP -2
30 R=J
40 FOR I=0 TO 2*PI STEP .1
50 X=R*COS(I)
60 Y=R*SIN(I)
70 PSET(40+X,40+Y)
80 NEXT I
90 NEXT J
REM See what happens when you change the values after STEP in lines 20 and 40.

Totally Awesome 320 x 200 resolution graphics!
Blazing Fast..3.5 Mhz! See it Go!


In Rev I converted ye olde compter programme to  the Nautilus

Then  iGame3D  switched to Lua so I learned lua
by going back to the roots and creating this :

Code:
-- circles with lua
function circles(halfWidth,halfHeight)
pi=3.14159
print("ok")
for j=30,2,-2 do
r=j
C=2*pi
for i=0,C,.1 do
x=r*math.cos(i)
y=r*math.sin(i)
pointx=halfWidth+x
pointy=halfHeight+y
print(string.format("%s%d%s%d","drawLine ",pointx,",0,",pointy))
end
end
end


And now...the murgaLua fltk graphic functions demo. ta-da!


RE: FLTK Graphics Functions - mikshaw - 06-30-2007 04:57 PM

I didn't know 'for' could go backward, or that you could change the step amount. That's more than payback for fullscreen =o)