Quick run showed this in console: 10/4/10 11:20:44 PM Quartz Composer[199] *** Message from <QCJavaScript = 0x5E033120 "JavaScript_1">: ReferenceError: Can't find variable: mass
Looks like it should be d.mass instead. .xX On Oct 3, 2010, at 3:00 PM, Mehmet Akten wrote: > Hi all, a much discussed topic I'm sure... > > I know QC is not designed as a 'proper' OOP programming language etc. so a > question regarding object oriented programming re quartz composer may be > irrelevant, but nevertheless I'm trying to get my head around how best to > tackle some basic data/behaviour management approaches in QC. > > Take this scenario (this isn't for anything so I don't have specific goal, > just a test case). > > Case 1: > I have N initial cubes, flying around with some basic behaviour. E.g. In this > particular case, I want them to each have a target point, they fly to their > target point based on various parameters (mass etc). When they reach their > target, they pick a new target and fly there. I'm sure I did this kinda stuff > in the past using global JS vars, but I couldn't get it to work this time. > I've attached my comp, if I have one iteration, I see my cube, but it doesn't > move. If I have more than 1 iteration, they all appear, but then disappear > after a short while. > > What I'm doing may be very hacky (JS patch in an iterator with a global array > of structures). THe feedback patch seems to try and address this issue, but > obviously doesn't work in an iterator. > > > Then there's more. Imagine a few more basic scenarios. > > Case 2: > 1. when I click in an empty space, a new object is created and added to the > flock > 2. when i click on an existing object, it is deleted > 3. pressing 'e' toggles the app between 'edit' mode and 'play' mode. in 'edit > mode they all stop moving and when you click on an existing object you get > some very basic options: > a. by clicking elsewhere you can set the new target for that object > b. pressing d deletes the object > c. numbers 1-9 defines how that particular object should be drawn > (texture, cube, sphere etc.) > d. etc. > > I can imagine how to do #3 (keep track of a bool in the root.data object). > and #3c (multiplexer). #1, #2, #3a and #3b should be straight forward too, > but its the data management that I can't get my head around. > > > I know if it gets too complicated it just makes sense to write a plugin, but > I just want to see exactly how far can can QC be taken in this way regarding > logic and behaviours. The scenario I mention above doesn't seem too > complicated, in fact is quite basic and I feel you should be able to do it > within a noodley environment. > > > <OOP test1.qtz> > > P.S. connecting the JS output to enable of a billboard worked by the way, > thanks for the tip alessandro > > Cheers, > > Memo. > > > > > MSA Visuals Ltd. > Unit 107 Netil Studios > 1-7 Westgate St. > London E8 3RL, UK > +44 20 8123 9986 > www.msavisuals.com > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Quartzcomposer-dev mailing list ([email protected]) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/quartzcomposer-dev/asabatelli%40apple.com > > This email sent to [email protected]
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to [email protected]

