Circle-based fractal(ish) project.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
calmrr3
Posts: 100
Joined: Mon Oct 28, 2013 2:39 pm

Circle-based fractal(ish) project.

Post by calmrr3 » Thu Nov 21, 2013 11:45 pm

Here I am trying to create a generative/ interactive piece.

Below is a rough(and inaccurate) plan of what I hope to achieve.

1. The card will open with only the large central circle showing.

2.When the circle is clicked, 3 lines stem out from the circle and at the end of these lines is a circle which is 3/4ths of the size of the first circle. And so on - Each time you click a circle, 3 more circles (each one 3/4ths the size of the one they stem from) appear. The lines will also get proportionally shorter.

Image


Due to the potential number of lines and circles, I don't think that creating the entire expanded image first and then just hiding/showing parts as they are clicked is the best way to do this, surely there must be a repeat loop or something that can achieve this it is essentially doing the same thing with each click

I'm still new to Livecode/ coding/ programming so a point in the right direction would be greatly appreciated!

Thanks!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: Circle-based fractal(ish) project.

Post by Simon » Fri Nov 22, 2013 12:10 am

Hi Callum,
create a generative/ interactive piece
For you, I think, it's best you mention this every time it is an "installation". Your questions are good but sometimes I try to figure the end result to come up with an answer. Your end results are not like the average poster here (send an email or something).

Anyways, "create" or "clone" is what you want I think.

Code: Select all

on mouseUp
   create graphic "Oval"
   set the rect of last graphic to 10,20,20,30
   set the loc of last graphic to item 1 the mouseLoc, 40 --well something like that
end mouseUp
it's a start.

Simon
Edit: You'll also want to:
"set the script of last graphic to"
all that stuff above with slight changes

Edit 2: Now that I think about it "clone" is better because it also clones the scripts. You just need to determine the max number (smallest circle) of clicks.
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

openworld
Posts: 63
Joined: Sat Sep 11, 2010 3:56 am
Location: Virginia, USA
Contact:

Re: Circle-based fractal(ish) project.

Post by openworld » Sat Mar 04, 2017 12:56 am

Calmrr3,

Just discovered your project on Vimeo to create fractal-like tree structures in Livecode.

Would it be possible to share some of the scripting you used to generate this branching behavior?

For the Learning Landscape prototype (summary posted in the LC Games area), I'd love to see a simple tree-like mind map created wherever a user wants to drag and drop a seed in a landscape.

Appreciate any help!

Best,

Mark
CirclesGeneratingBranches-CallumRitchie.png
CirclesGeneratingBranches-CallumRitchie.png (39.02 KiB) Viewed 2284 times

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”