Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32617

Re: Field Collisions Anime...

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From "Chris M. Thomasson" <invalid@invalid.invalid>
Newsgroups comp.lang.javascript
Subject Re: Field Collisions Anime...
Date Sun, 12 Feb 2017 20:00:27 -0800
Organization n/a
Lines 51
Message-ID <o7rate$c6c$1@dont-email.me> (permalink)
References <o7op8l$otg$1@dont-email.me> <0161d58e-ee3e-408b-aa2d-aa7b0247767d@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Mon, 13 Feb 2017 03:58:38 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="3cd205dee6ea66f62755079ba0e04480"; logging-data="12492"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//MtOdX25YLYb1o1KfkXqSmV9CpMFVT4k="
User-Agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
In-Reply-To <0161d58e-ee3e-408b-aa2d-aa7b0247767d@googlegroups.com>
Cancel-Lock sha1:LfhnfrUxFsrulsCUs5d83lsaN+s=
Xref csiph.com comp.lang.javascript:32617

Show key headers only | View raw


On 2/12/2017 7:59 AM, Michael Haufe (TNO) wrote:
> Chris M. Thomasson wrote:
>> Here is the non-interactive pre-alpha test origin of a "collision
>> avoidance system" based on vector fields. Its meant to be a fun,
>> hopefully interesting, experiment. So far, the damn field lines just
>> want to help the vehicles in circles avoid crashes. In this crude setup,
>> a collision will make the anime flash, and tangentially move the
>> colliding agents out of the way. The crude online example is here:
>>
>> http://funwithfractals.atspace.cc/ct_gf_explore
>> (does this work for you at all?)
>>
>> Fwiw, I first posted about this here:
>>
>> https://plus.google.com/101799841244447089430/posts/JmbpLWvdJEf
>> (has a screenshot of the program...)
>>
>> Can you please give it a go? Is it slow as shi%? Crap?
>>
>> Any radical bugs in the JavaScript? ;^o
>>
>> Thanks.
>
> averaging about 16 FPS. Nearly 20% of the time spent on Garbage Collection.

Yup. Its because of all the damn arrays. The code uses them in the 
animation loop. Fwiw, this is in relation to:

https://groups.google.com/d/topic/comp.lang.javascript/dgakiMzhgv0/discussion

I did a benchmark, and the array version is slower.


>
> There are a significant number of optimizations that could be done here, such as double-buffering, not drawing in Immediate Mode, and others.
>
> Missing 'use strict' pragma
>
> JSHint shows a number of minor issues you should handle: <http://jshint.com/>

Thank you Michael. Will study the problems.


>
> Aside: You seem to write JavaScript like a C or C++ programmer which is a little strange.
>

Big time. I am actually not all that used to JavaScript. However, its a 
nice little medium to get some quick, hopefully portable, animations up, 
to see whats going on.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Field Collisions Anime... "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-02-11 20:46 -0800
  Re: Field Collisions Anime... jonas.thornvall@gmail.com - 2017-02-11 23:00 -0800
    Re: Field Collisions Anime... "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-02-13 16:15 -0800
  Re: Field Collisions Anime... jonas.thornvall@gmail.com - 2017-02-12 01:27 -0800
    Re: Field Collisions Anime... "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-03-05 18:47 -0800
  Re: Field Collisions Anime... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-02-12 07:59 -0800
    Re: Field Collisions Anime... "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-02-12 20:00 -0800
      Re: Field Collisions Anime... "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-02-14 18:16 -0800
        Re: Field Collisions Anime... "Chris M. Thomasson" <invalid@invalid.invalid> - 2017-02-14 18:27 -0800

csiph-web