Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #34097
| From | "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: pre-alpha vector field DLA, with point-and-click attractors... |
| Date | 2017-10-04 20:48 -0700 |
| Organization | n/a |
| Message-ID | <or4a2m$kn$1@dont-email.me> (permalink) |
| References | <oqa2aa$le4$1@dont-email.me> <oqcipr$avm$1@shakotay.alphanet.ch> <oqh155$so9$1@dont-email.me> <1d1370dc-ca4c-4d96-839a-9c306b740c05@googlegroups.com> |
On 9/30/2017 8:41 AM, Michael Haufe (TNO) wrote: > Chris M. Thomasson wrote: >> >> Thank you for giving it a go Une! I can make it better wrt a different >> way of programming. This tends to overwhelm the cpu with computation and >> the use of the garbage collector. Wrt GC, the JavaScript engines tend to >> create new object for every array passed to a function. For instance, I >> can pass two 3d points and a radius like this wrt the style of my >> current code: >> >> foo([-1, 0, 0], [1, 0, 0], 1); >> >> Each array index is mapped to (a[0] = x), (a[1] = y) and (a[2] = z). >> >> This will create two damn arrays for each call! And those go into the >> GC. Read here for some further information: >> >> https://groups.google.com/d/topic/comp.lang.javascript/dgakiMzhgv0/discussion >> >> Also, it can burn CPU because DLA points never die off! I need to allow >> them to die off and leave the per-field-line segment vector field >> summation. The more points, the slower it goes. I wonder if changing the >> color of the field lines to grey, or some color that designates turning >> "brown/yellow", or the interpolation of the death cycle wrt specific >> colors. The act of death would take pressure off the core field logic >> wrt reducing iterations. > > > I threw a quick codepen together of your code and did a very high level translation to ES6+ with minimal impact: > > <https://codepen.io/mlhaufe/project/editor/XNGeEv#0> > > I'm hoping this could aid in the discussion and evolution. > > I didn't see why you needed the requestAnimation polyfill. I think there is sufficient support for it now: > > <http://caniuse.com/#feat=requestanimationframe> > Your codepen works like a charm Michael! Thank you so much for your time and energy wrt helping my code be more modern. Seriously, I am a little stuck in the past wrt JavaScript, the polyfill for anime loop. Ack. Well, I did go a step further and implemented my experimental vector field in a GLSL shader: https://www.shadertoy.com/view/XljcRR Does this work for you? Thanks again man. :^)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-24 21:56 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... Julio Di Egidio <julio@diegidio.name> - 2017-09-24 22:36 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-24 22:44 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... Julio Di Egidio <julio@diegidio.name> - 2017-09-24 22:54 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-25 12:31 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... Julio Di Egidio <julio@diegidio.name> - 2017-09-26 09:05 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-28 21:24 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... Julio Di Egidio <julio@diegidio.name> - 2017-09-29 06:47 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-25 12:39 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-09-25 22:00 +0200
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-25 13:25 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-09-25 22:36 +0200
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-27 13:38 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... Une Bévue <unbewusst.sein@fai.invalid> - 2017-09-26 05:50 +0200
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-09-27 13:19 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-09-30 08:41 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Chris M. Thomasson" <invalid_chris_thomasson@invalid.invalid> - 2017-10-04 20:48 -0700
Re: pre-alpha vector field DLA, with point-and-click attractors... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-10-05 08:25 -0700
csiph-web