|
Post by johnno56 on Jun 23, 2019 16:11:34 GMT -6
Brilliant! I'm going to study THIS one to see how you fixed it. I modified line#44 to read: particleLife = range(20,60)
Reason: Each particle needs to have a 'life of its own'. Just like the a sparkler firework. All of the sparkles do not extinguish at the same time... But, making THAT change, kind of makes the 'life' parameter in the particle command a bit redundant... lol But it does look nicer...
Thank you SO much for fixing this... Much appreciated.
|
|
|
Post by tbird on Jun 23, 2019 16:16:07 GMT -6
My pleasure, yes random particle life does look alot nicer. Can't wait for the next step.
|
|
|
Post by johnno56 on Jun 23, 2019 18:53:46 GMT -6
I have moved the focus point to the center and trying to introduce more colour. By the way, now that you "fixed it", I have been experimenting with the number of particles. I have found, on my machine any way, any fewer that 100 particles means I have to put a very small wait in the for next loop. So far it can handle 2,000 particles (minus the wait) without any noticeable lag. Only downside is, that is one large cluster, until the velocity picks up... I have been attempting to read through the website and noticed some serious coding down the track. I will go as far as I can but even my feeble skills have limits... lol This is my current experiment... include the wait statement if you want to see how it runs otherwise don't blink... lol test03.zip (1.03 KB)
|
|
|
Post by tbird on Jun 23, 2019 19:30:17 GMT -6
Well if you run into troubles point me in the direction and I will help as best I can, I have experience, albeit limited, in JS and C++.
|
|
|
Post by johnno56 on Jun 23, 2019 21:26:52 GMT -6
Cool...
|
|
|
Post by johnno56 on Jun 24, 2019 1:53:35 GMT -6
A little particle system trivia. The Particle System was introduced in 1982 and featured in "Star Trek II: The Wrath of Khan". It was used to display the "Genesis Effect".
|
|
|
Post by tbird on Jun 24, 2019 7:37:14 GMT -6
I had to look up a youtube clip of what that was, pretty good for '82.
|
|
|
Post by johnno56 on Jun 24, 2019 17:39:17 GMT -6
Yeah... But there was 'no' mention as to whether it was created 'live' or frame-by-frame. I'm going to assume the latter, mainly because, processors weren't all that good back then... In either case, you are correct, pretty good for its time... This video is quite old, does not go into detail, but explains a little of how it was done... www.youtube.com/watch?time_continue=1&v=Qe9qSLYK5q4
|
|
|
Post by tbird on Jun 26, 2019 7:46:01 GMT -6
Finally had a look at the video, pretty neat actually. I love watching old vid's when they state "state of the art", makes me smile.
How goes the particle engine tut?
|
|
|
Post by johnno56 on Jun 26, 2019 10:10:45 GMT -6
I haven't got very far with it at all. Only a slight improvement from the last posting. The next phase, according to the website, is the Emitter. I have to tell you that, trying to make sense of the code for this section, it may as well have be written in Chinese. Not knowing JS is not helping. From there the next part is rendering and textures and then physics. The amount of coding, by this time, has reduced quite a bit. The article seems to indicate that the reader should know what to do next...
I have continued looking for instructions in Basic and haven't found any yet. Most of the tutorials are about creating particles with existing engines. I'm kind of stuck between a rock and a hard place. I don't like quitting a project when part way through, but I just don't have the skillset to finish.... the one thing that I have learned from all this, is that, I found out there is something else I cannot do.... *sigh*
This is so embarrassing... My apologies.
|
|
|
Post by tbird on Jun 26, 2019 12:38:43 GMT -6
I just had a quick look, so basically it's talking about not reusing the same ID, so you know what would work awesome for that....an ID Pool, hmm I think someone put an example of one of those on here...hang on...
ah here it is:
So you would simply set the MAX_PARTICLES to whatever someone sets it as when they are making their particle effect, and the rest is in the example I posted. If you need an example with the particles implemented shoot me a message and I will whip one up for ya.
No need for apologies johnno56, everything you can't do is just something you haven't learned, and as such something you can't do yet.
|
|
|
Post by eyfenna on Jul 20, 2019 1:25:07 GMT -6
looks great tbird, with a little change of the update function it is more fun to watch for me:
function particleUpdate(p) ' DECIMENT THE LIFE PERIOD particleLife[p] = particleLife[p] - 1 ' IF PARTICLE IS DEAD if particleLife[p] = 0 then particle(i, 400, 450, 50, 180, 10, rgb(255,255,255)) end if ' IF STILL ACTIVE THEN UPDATE if particleLife[p] > 0 then particleX[p] = particleX[p] + particleVelX[p] particleY[p] = particleY[p] + particleVelY[p] end if end function
the emitter is just from what I understand the starting position in the beginning and after the particle lifetime ends.
Adding following line in the update function will make particles disappear while moving:
' MAKING THE PARTICLE TRANSPARENT alpha = (particleLife[p]*5)+5 particleColor[p] = rgba(255,255,255,alpha)
|
|
|
Post by tbird on Jul 20, 2019 13:56:16 GMT -6
The transparency was a nice touch, that looks great. It's the making of a general use particle engine....*hint* *hint* 😁
|
|
|
Post by eyfenna on Jul 21, 2019 9:55:12 GMT -6
In one week time I'm back from my visit to my relatives after that I look into this and support you in translating the js stuff into rcbasic.
the emitter is the type of variable that does what the update function in the rcbasic particle code does plus a respawn function.
Particle pool is a object pool geared towards speed by moving particles with lifetime to the low array numbers and particles without lifetime to the high array position.
|
|
|
Post by tbird on Jul 21, 2019 22:20:46 GMT -6
Well, I will help contribute a bit also, this is johnno56 baby, lol.
|
|