ah thanks yea, that should be d.mass , not mass.
also it should be pos += vel / mass, not pos = vel / mass. (i haven't slept
much this past week).
So that explains the disappearing.
It seems the update() is called only once per run. Even though in debug mode
the JS patch is flashing red every frame, if I set pos to random every frame,
it still doesn't move. So I need to make it get called every frame some how.
Maybe that isn't too complicated, then there is still the Case 2 :)
P.S. I've pulled this thread in from the Quartz list to the QC list.
MSA Visuals Ltd.
Unit 107 Netil Studios
1-7 Westgate St.
London E8 3RL, UK
+44 20 8123 9986
www.msavisuals.com
On 3 Oct 2010, at 20:27, George Toledo wrote:
> Also.... still sussing out where you are going/what you need to do (sorry,
> it's taking a moment to sink in).
>
> ...but I just opened up the composition and ran it. Mass wasn't being
> declared anywhere, and if you did declare it where you have it in the
> javascript, it will "fart out" (excuse my highly technical term).
>
> This re-order allows there to be a mass value that doesn't cause error in the
> javascript compiler. Apologies if my re-order precludes something that you're
> trying to accomplish that's going over my head (as in, I'm still sussing out
> the desires in your original post, in relation to this qtz.)
>
> -GT
>
> On Sun, Oct 3, 2010 at 3:16 PM, Mehmet Akten <[email protected]> wrote:
> Thanks george, that makes perfect sense, I'll git it a shot.
>
> P.S. I accidentally posted this to the quartz dev list first. I reposted on
> the QC list too as its more related to that. Probably best not to continue
> this thread on this list. Apologies for the double post.
>
>
>
>
> MSA Visuals Ltd.
> Unit 107 Netil Studios
> 1-7 Westgate St.
> London E8 3RL, UK
> +44 20 8123 9986
> www.msavisuals.com
>
> On 3 Oct 2010, at 20:11, George Toledo wrote:
>
>> Quick note: still reading through your case scenarios; the feedback patch
>> will work inside of the iterator if you don't have consumer patches. The
>> results can then be gathered in a queue and published out, where the values
>> can then be iterated through again if necessary. Not saying this is
>> necessarily always efficient, but it's possible.
>>
>> -GT
>>
>> On Sun, Oct 3, 2010 at 2:58 PM, Mehmet Akten <[email protected]> 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.
>>
>>
>>
>>
>> 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.
>> Quartz-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/quartz-dev/gtoledo3%40gmail.com
>>
>> This email sent to [email protected]
>>
>>
>>
>> --
>> George Toledo
>> [email protected]
>> www.georgetoledo.com
>>
>> The information contained in this E-mail and any attachments may be
>> confidential.
>> If you have received this E-mail in error, please notify us immediately by
>> telephone or return E-mail.
>> You should not use or disclose the contents of this E-mail or any of the
>> attachments for any purpose or to any persons.
>>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Quartz-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/quartz-dev/gtoledo3%40gmail.com
>
> This email sent to [email protected]
>
>
>
> --
> George Toledo
> [email protected]
> www.georgetoledo.com
>
> The information contained in this E-mail and any attachments may be
> confidential.
> If you have received this E-mail in error, please notify us immediately by
> telephone or return E-mail.
> You should not use or disclose the contents of this E-mail or any of the
> attachments for any purpose or to any persons.
>
> <OOP test1_b.qtz>
_______________________________________________
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]