View unanswered posts | View active topics It is currently Fri Dec 27, 2024 11:04 pm



Reply to topic  [ 5 posts ] 
 Draw a line with a pixel trail 
Author Message
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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.


Fri Sep 09, 2011 3:20 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Draw a line with a pixel trail
An easier method would be using the draw line systems provided by Lua.


Fri Sep 09, 2011 4:57 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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.


Fri Sep 09, 2011 9:05 pm
Profile WWW
User avatar

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
Reply with quote
Post 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


Fri Sep 09, 2011 9:43 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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.


Fri Sep 09, 2011 10:08 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.025s | 15 Queries | GZIP : Off ]