View unanswered posts | View active topics It is currently Tue Feb 18, 2020 4:30 am

 Page 1 of 1 [ 5 posts ]
 Print view Previous topic | Next topic
Draw a line with a pixel trail
Author Message

Joined: Sat Jun 19, 2010 5:02 pm
Posts: 331
Location: Mekkan
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
Data Realms Elite

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
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
DRL Developer

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

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

Fri Sep 09, 2011 9:43 pm
DRL Developer

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3136
Location: A little south and a lot west of Moscow
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
Display posts from previous:  Sort by
 Page 1 of 1 [ 5 posts ]

#### Who is online

Users browsing this forum: No registered users

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

Search for:
 Jump to:  Select a forum ------------------ Cortex Command    Dev Log    Wiki    Game Discussion    Game and Licensing Support    Mod Making       Lua Scripting       Requests    Mod Releases       Older Mods    Scene Releases       Scene Making Planetoid Pioneers    Game Discussion    Pioneer Program Lounge Data Realms Off-Topic    Off Topic Chat       Gaming       Forum Games    Site Support & Feedback