So yea ... I'm building this graphics app, and getting alot done, except I'm beginning to realize just how lame it's going to be without a nice smooth line. If you move the mouse too quick it makes dots instead of lines. The problem seems to be that TGF just won't paste into the background quick enough to keep up with the mouse on a quick flick of the wrist.
I'm thinking maybe I could constantly store positions into seperate variables and have it paste into background after already having traversed the path with the mouse, and set that variable back to zero to be re-used again for the next section of line after it's been pasted for that variable (for each variable used, there'd need to be many). Sort of a List that it goes down and checks if the value is zero and if it's not, stores the current x and y positions in it, then moves on to the next one doing the same and so on.
The real problem is that I don't know how to do that!
Please Please Please let one of you know the solution to this. It's probably simple for alot of you out there. Would ini's be a good start for this Or should I try an' fiddle round with counters or alterable values or some sort of grid of data storage, or what?
I don't know where to begin with this one.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
unfortunately yes. the faster you scribble the mouse the less smooth your drawing will become. you can use bezier curves if youre comfortable with the math. but other than that, using lines to complete point to point drawing is the easiest way.
You wouldn't happen to have an example laying around for either way would ya?
I've been trying the DrawLine way with FastLoop and I'm obviously doing something wrong.
Also, I've tried to look at this example in MMF2, but the DrawLine.mfx does not seem to exist.
What's up with that? All I can find anywhere is DrawLine.cox and DrawLine.gox and neither of those will work when I change the end to .mfx
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
I was thinking paste to clipboard or something. Hopefully that's possible in TGF. I can always do something more complicated once it's finished and I'm revising it in MMF2.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Originally Posted by Robot Cecil unfortunately yes. the faster you scribble the mouse the less smooth your drawing will become. you can use bezier curves if youre comfortable with the math. but other than that, using lines to complete point to point drawing is the easiest way.
though the problem with bezier curves is that you have to figure out how you're going to generate decent inside control point(s) from your mouse movement
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
22nd April, 2010 at 09:21:45 -
Originally Posted by Xgoff though the problem with bezier curves is that you have to figure out how you're going to generate decent inside control point(s) from your mouse movement
I would say use a Cubic Bezier curve:
P0 = Starting Point
P1 = Point halfway between the two with mouse speed multiplied by some factor added to it.
P2 = End Point
So you know P0 and P2, Then to calculate speed you can simply take:
(P2-P0) / 50
Where 50 is the framerate, or some value that you need to modify to taste. Then you multiply that by some constant to taste, for example:
P1 = 0.08(P2-P0)
Do that in both the X and Y direction and I think it would curve pretty well.
Aren't you missing the P3? .. or is that needed? ... an' that's all well and good, but I'm at a complete loss on what to do in TGF to actually make it happen.
There is another way that might work as well .... BUT .. I don't know how to put that into action either.
Basically, the idea would be to have a "ninja shadow" that follows the same path that the mouse takes but at a slower speed so the line which gets drawn will be solid rather than dotted.
I think that may be the easiest method to understand and accomplish, but I could be wrong.
Anyone know how to do such a thing in a simple to understand way?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?