Thank you so much what I needed to find p3!!
I'm going to make some changes to make the effect more beautiful by calculating also alpha ect as said @roaminggamer in past
Anyway now I should have everything I need to do it myself!
Jump to content
You almost got it there dude, here is a piece of code that is working as you want:
take this fwiw, not meant to sound nitpicky..
if you're interpolating the trail positions separately from the ball's position, you're likely to get weird results whenever the ball bounces off a wall (because the shadows interpolate assuming full vx/vy were applied, but wall prevented that). to solve: interpolate ball's position in smaller dt's, creating trails as you go.
when bouncing (aka reflecting) off walls you shouldn't clamp position, because you'll lose velocity. (player will see it as a "stutter") work it out in your head: say x=473, xmax=480, vx=10. after a full time step x would be 483, but reflects back to 477, so that all vx=10 is accounted for. pseuducode is "if (x > xmax) then x=xmax-(x-xmax) end" and similarly for other walls.
@naveen_pcs I might have a go at it, though some ideas will need time to stew. Also it's not clear if the curve logic (most likely curated from those modules linked earlier) should be included or a separate plugin it would build on. Anyhow, I've got a list to whittle down first, things like Clipper...
@davebollinger ...and it sounded like you might have been alluding to Cosmin's wrapper in Luapower, which was where I first discovered it. I think I'll have to adapt that sample. Originally I meant to hew more closely to his API, but there seems to have been some drift since then in Clipper itself. I should probably send stuff like this along to LuaRocks too, at some point.
So after a few days, I managed to get a really decent effect.
But of course it works fine only if the object does not make tight turns.
I'm still far from what I really thought
But I'm seeing some really wonderful things here!
I would also like to see how it will be once your project is finished @StarCrunch
A follow-up about the Clipper plugin mentioned above. I've been putting together some examples for it and am looking to submit in another week or so. It will probably land along with msquares (whose own samples I'm meaning to spruce up) around the same time.
Sample so far, with maybe two or three more ideas pending:
@Sig.g1 I haven't submitted yet, but might over the weekend. (Lately I've managed to distract myself binding this and this.) You should be able to see the sample's code through the Clipper link above, though. There were a couple other cases I planned to add (Minkowski difference; Luapower-ish all-in-one scene), but it's probably ready enough now.
The "Polygon offset" scene shown in the last few seconds of the video, adapted from an example in Clipper's docs, demonstrates the capability @davebollinger mentioned earlier.
@StarCrunch - i thought i'd seen one, but couldn't remember, that may have been it.
aside: tinkered briefly cleaning up some personal code, still pretty special-use, might eventually? be suitable for market
Community Forum Software by IP.Board