Data Realms Fan Forums
http://45.55.195.193/

Draw a line with a pixel trail
http://45.55.195.193/viewtopic.php?f=73&t=25460
Page 1 of 1

Author:  Awesomeness [ Fri Sep 09, 2011 3:20 am ]
Post subject:  Draw a line with a pixel trail

Would it be possible to draw a line between two points by using an MOPixel, and its trail? You could "pin" it by setting its position every frame and still give it a velocity by also setting a velocity every frame.

Author:  Roast Veg [ Fri Sep 09, 2011 4:57 pm ]
Post subject:  Re: Draw a line with a pixel trail

An easier method would be using the draw line systems provided by Lua.

Author:  TheLastBanana [ Fri Sep 09, 2011 9:05 pm ]
Post subject:  Re: Draw a line with a pixel trail

Except they don't work, so you have to use MOPixels.
I actually don't know if this technique would work - you'd have to try it. I think the pixel would need to be unpinned, though. Another way of doing it (which is more commonly used) is to make a line with each pixel being one MOPixel, but this could be less laggy if it actually works. I'd imagine there would be some other issues with this technique, though.

Author:  Awesomeness [ Fri Sep 09, 2011 9:43 pm ]
Post subject:  Re: Draw a line with a pixel trail

If an MOPixel moves faster, its trail gets longer right? If so, is there a trail length where the trail expands at a 1:1 ratio to the velocity? Because then you could set the pixel's Pos to the stating point of the line, and set the velocity of it to the starting point minus the end point's position. You'd have to do it eveything frame. May require inversion.

If the trail length stays consistent regardless of speed, which seems a little more likely, you would need to do the same, but also set the TrailLength to the distance between the two points, rounded.

Or, maybe neither of these work. :P

Author:  TheLastBanana [ Fri Sep 09, 2011 10:08 pm ]
Post subject:  Re: Draw a line with a pixel trail

I understand the theory, it's just that CC has a way of behaving unexpectedly. You'd have to test it and see if it works. One thing I know for sure is that trail length has to do with how far a pixel moves in one frame - if DeltaTime is low, the trails become smaller. That isn't hard to compensate for, but I'd imagine there are other such issues you'd need to sort out.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/