Drawing Program Problem

Blitz3D Forums/Blitz3D Programming/Drawing Program Problem

alloidgames(Posted 2006) [#1]
Hi, I'm trying to make a basic drawing program, and having a bit of trouble! I want it where of course you hold down the left mouse button and drag it to make lines, curves, whatever, but the problem is that if I just do Plot MouseX(),MouseY() and I move the mouse too fast, it just does a dot every so often along the line of the mouse (Basically it doesn't make a connected line)

I've tried MANY MANY things to fix this, from the simple to the overly complex, but I just can't do it! What's the problem with Plot MouseX(),MouseY(), and how do I fix it?


Beaker(Posted 2006) [#2]
Something like this in your loop:
mx = MouseX()
my = MouseY()
Line lastx,lasty, mx,my
lastx = mx
lasty = my



alloidgames(Posted 2006) [#3]
Ah, that does work! Thank you very much! I had tried a lot of things with lines, and even thought I did something like this, but whatever!


Steven Noyce(Posted 2006) [#4]
That is good, but would look very blocky if you moved the mouse to fast. A good cubic spline interpolation technique might work. Using vectors would probably work best. I am thinking about doing something like this later, so I might post again later if I figure out something good. Right now I am going to bed because I have a scout camp that starts at 3:00 in the morning tomorrow, so no time to expiriment or get an example ready. I will be back in about a week. Bye.