Well, I have been seeing many others creating trails using the particle systems that LOVE2D has provided, but what I seen in some other games is that they use a ribbon type of mesh that gets created. Basically what I wanted to share is similar to this using the new version of LOVE2D (0.9.0). Not sure if anyone else has made one yet.
Settings:
(x, y, image, width of trail/ribbon, trail lifetime, interval (how "detailed" the trail is), method ("stretch" default, "repeat"))
or you can look at the file itself to see how it works
I'm still new to this so if the script is quite dirty, please tell me if there is a was to optimize it, math is still fresh in my mind since I'm still in school so I might understand what you may say. Also I am trying to understand classes more, I'm used to python.
Trail Meshes
Trail Meshes
- Attachments
-
- Trailmesh.love
- (3.76 KiB) Downloaded 569 times
- NightKawata
- Party member
- Posts: 294
- Joined: Tue Jan 01, 2013 9:18 pm
- Location: Cyberspace, Room 6502
- Contact:
Re: Trail Meshes
Very nice.
Just an image if anyone wanted to see what this looked like.
Just an image if anyone wanted to see what this looked like.
"I view Python for game usage about the same as going fishing with a stick of dynamite. It will do the job but it's big, noisy, you'll probably get soaking wet and you've still got to get the damn fish out of the water." -taylor
Re: Trail Meshes
Yea, that is how it looks like. If he would have moved the mouse faster you would see the little things that orbit the circle follow the same behavior. My only problem is the overlapping where you can see lighter parts an random cuts when you stop for a moment then move again.
To me I think it would look better when used with a game that has some sort of physics. (either one made up or used by the 2d box physics engine) instead of something that is... well, stiff like the mouse.
To me I think it would look better when used with a game that has some sort of physics. (either one made up or used by the 2d box physics engine) instead of something that is... well, stiff like the mouse.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Trail Meshes
Amazing! I've wanted this feature for years!
Seriously, ribbons are a powerful basic tool for adding visual flair, much like particle effects. Blizzard has used them in every game of theirs since 'Warcraft 3'. If I could request any feature to be added to this, it would be the ability to add motion to individual trail "points". This would open up even more graphical possibilities, like some of the fancier effects used in 'Half-Life 2: Episode Two'.
EDIT) Take that, mysterious code! I modified it so each trail point can have its own position and velocity. I've uploaded my improved version of your demo, download it here!.
What's added:
- A bit of cursor smoothing (it makes everything look much nicer)
- Colors
- A second, thicker dotted trail, except this one "jets out" opposite the motion of the cursor
- A fourth blue trail, except this one changes width and drifts upward and reacts to cursor motion somewhat like smoke
- A green trail which just moves to the right. Simple, but pleasing to watch
Seriously, ribbons are a powerful basic tool for adding visual flair, much like particle effects. Blizzard has used them in every game of theirs since 'Warcraft 3'. If I could request any feature to be added to this, it would be the ability to add motion to individual trail "points". This would open up even more graphical possibilities, like some of the fancier effects used in 'Half-Life 2: Episode Two'.
EDIT) Take that, mysterious code! I modified it so each trail point can have its own position and velocity. I've uploaded my improved version of your demo, download it here!.
What's added:
- A bit of cursor smoothing (it makes everything look much nicer)
- Colors
- A second, thicker dotted trail, except this one "jets out" opposite the motion of the cursor
- A fourth blue trail, except this one changes width and drifts upward and reacts to cursor motion somewhat like smoke
- A green trail which just moves to the right. Simple, but pleasing to watch
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Re: Trail Meshes
The way vertices disapears after it's life time is weird
And line joint are bad when angle is sharp
I will work on thatRe: Trail Meshes
If you can post a fix of it, that would be great for others to see, this was my first attempt to achieve what other game engines has been doing, like I said its dirty but gets most of the job done. I'll probably edit the first post, its been a while since I used lua but im still used to it. Maybe better preview images too. Its up to you anyways.
Re: Trail Meshes
I think this would make a great little library that would be super helpful to people .
Re: Trail Meshes
I managed to fix the vertex removal problem,
Fixed the texture was flipped
I have completely rewritten the library using vector.lua and merged the method "stretch" and "repeated" together
I have added a color transition like in ParticuleSystem
I'm working on the line joint problem
and I will add a width transition after a look on Taehl's work
The vertex index is for debug purpose
Fixed the texture was flipped
I have completely rewritten the library using vector.lua and merged the method "stretch" and "repeated" together
I have added a color transition like in ParticuleSystem
I'm working on the line joint problem
and I will add a width transition after a look on Taehl's work
The vertex index is for debug purpose
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: Trail Meshes
Superb work! I'm so glad this is being refined. If you need help dissecting my code, or would rather discuss the concept rather than my implementation, please feel free to contact me.
The general idea is, you want trail points to be able to independently execute simple transformations, rather than just staying in at their point of creation.
The general idea is, you want trail points to be able to independently execute simple transformations, rather than just staying in at their point of creation.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest