Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Trail effect with emitter?
Started by Sig.g1 Jun 10 2018 02:59 AM

37 replies to this topic
trail effect emitter
[TOPIC CONTROLS]
Page 2 of 2 1 2
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#26

Sig.g1

[GLOBAL: userInfoPane.html]
Sig.g1
  • Enthusiast

  • 98 posts
  • Corona SDK

@david.ciaudo

 

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!



[TOPIC: post.html]
#27

naveen_pcs

[GLOBAL: userInfoPane.html]
naveen_pcs
  • Contributor

  • 266 posts
  • Corona SDK

I'd love if someone made a plugin for this. Not with display.newObjects but actually doing it properly. I know I'd pay good money for that :)



[TOPIC: post.html]
#28

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,345 posts
  • Enterprise

Working on it.  :D (See the text rendering plugin topic.)

 

i knew if anyone had it, it would be you! :)



[TOPIC: post.html]
#29

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,345 posts
  • Enterprise

 

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.

 

hth



[TOPIC: post.html]
#30

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 813 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#31

davebollinger

[GLOBAL: userInfoPane.html]
davebollinger
  • Corona Geek

  • 1,345 posts
  • Enterprise

@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

 

2QDs8Lz.png

 



[TOPIC: post.html]
#32

Sig.g1

[GLOBAL: userInfoPane.html]
Sig.g1
  • Enthusiast

  • 98 posts
  • Corona SDK

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  :D



[TOPIC: post.html]
#33

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 813 posts
  • Corona SDK

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:

 



[TOPIC: post.html]
#34

Sig.g1

[GLOBAL: userInfoPane.html]
Sig.g1
  • Enthusiast

  • 98 posts
  • Corona SDK

It looks really great! I try it now, thank you very much.

 

and sorry for being late



[TOPIC: post.html]
#35

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 813 posts
  • Corona SDK

@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.



[TOPIC: post.html]
#36

Sig.g1

[GLOBAL: userInfoPane.html]
Sig.g1
  • Enthusiast

  • 98 posts
  • Corona SDK

I realized later, at the beginning I just wanted to hurry up and try :rolleyes:

 

So I take a look at clipper link. I look forward to the "full" launch!



[TOPIC: post.html]
#37

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 813 posts
  • Corona SDK

@Sig.g1 Update on this: it's now out. Let me know if you try it and have any questions.



[TOPIC: post.html]
#38

naveen_pcs

[GLOBAL: userInfoPane.html]
naveen_pcs
  • Contributor

  • 266 posts
  • Corona SDK

@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
 
2QDs8Lz.png


This is exactly the kind of thing I’m looking for! I really hope you consider making this into a plug-in.


[topic_controls]
Page 2 of 2 1 2
 
[/topic_controls]