News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
FLTK Graphics Functions
Author Message
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #1
FLTK Graphics Functions

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.



Attached File(s)
.zip File  murgaFLTKDrawFunctionslua.zip (Size: 2.23 KB / Downloads: 24)

This post was last modified: 06-29-2007 04:32 PM by iGame3D.

06-29-2007 04:12 PM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #2
RE: FLTK Graphics Functions

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.

06-30-2007 12:52 AM
Find all posts by this user Quote this message in a reply
iGame3D
Moderator
***


Posts: 231
Group: Moderators
Joined: Apr 2007
Status: Offline
Reputation: 0
Post: #3
RE: FLTK Graphics Functions

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!

This post was last modified: 07-05-2007 09:05 AM by iGame3D.

06-30-2007 08:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #4
RE: FLTK Graphics Functions

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

06-30-2007 04:57 PM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: