r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[View] discuss view related issues

Geomol
1-Sep-2005
[2412]
There seem to be a small anomaly, when doing thick circles and ellipses, 
in the right side, where the circle/ellipse starts and ends. It may 
have something to do with "line-cap round", but if that is left out, 
there will be a tiny gap, when drawing really thick circles/ellipses.

Maybe Cyphre should check it out!?
Henrik
1-Sep-2005
[2413x2]
I changed BITMAP-SIZE to 1024x768 and as I suspected it really slows 
down now...
it could be a graphics driver problem, but I also tried it on my 
linux laptop and it's also very slow there.
Geomol
1-Sep-2005
[2415]
Henrik, it must be something special with your setup, and you get 
slow console output on the
do http://www.rebol.com/speed.r

speed-test, as we talked about. You could post your speed output 
here somewhere and specify your setup. Maybe others have a solution!
Henrik
1-Sep-2005
[2416x4]
Console:   0:00:16.274 - 31 KC/S
Processor: 0:00:00.631 - 1369 RHz (REBOL-Hertz)
Memory:    0:00:01.943 - 24 MB/S
Disk/File: 0:00:01.121 - 27 MB/S
I have an ATI Radeon 9500 graphics card with the latest Catalyst 
drivers and the test is run on a Celeron 2.6 Ghz PC with 640 MB of 
PC133 memory
adding a framerate limiter in your code helps nothing
but I've always had this problem that painting large surfaces in 
REBOL takes a long time on my machine and it doesn't really matter 
what drivers I use
Geomol
1-Sep-2005
[2420]
I get:
Console:   0:00:01.703 - 297 KC/S
Processor: 0:00:00.406 - 2128 RHz (REBOL-Hertz)
Memory:    0:00:01.344 - 35 MB/S
Disk/File: 0:00:00.203 - 150 MB/S

on a 2.4GHz Pentium 4, 512 MB ram (not sure about speed, it's an 
ASUS P4P800 board), ATi Radeon 9600, not the newest drivers.
Henrik
1-Sep-2005
[2421x3]
ok, I take back the part of the framerate limiter :-)
try this: http://hmkdesign.dk/rebol/canvas.r
ah... it's dangerous, because it misses events on my slow laptop 
now, but drawing is much speedier on my "broken" PC
Geomol
1-Sep-2005
[2424]
Well, it's a work-around, if you have slow graphics.
Henrik
1-Sep-2005
[2425]
I've put a limiter on SHOW so that it only shows every interval, 
but doesn't miss as many position samples. so even though the framerate 
appears slow, it's actually very responsive. it's SHOW that's the 
killer.
Geomol
1-Sep-2005
[2426]
Oki doki!
Henrik
1-Sep-2005
[2427]
sorry, it only shows every X interval... adjustable in the display-canvas 
function
Geomol
1-Sep-2005
[2428]
We have to see, when there is more stuff in the program, if I should 
put in such a mechanism.
Henrik
1-Sep-2005
[2429]
ok, looking forward to see some progress :-)
Geomol
1-Sep-2005
[2430]
:-) Just fixed a bug with line tool, if start and end point is the 
same. Well, that's progress! ;-P
Henrik
1-Sep-2005
[2431]
alright. :-) would it be hard to add straight X/Y line drawing with 
the shift key?
Geomol
1-Sep-2005
[2432x5]
:-D Didn't remember that before now. I'll check it on my Amiga...
Hmm the feel function "over" doesn't get an event, but engage do. 
Shift can be checked with event/shift.
So it's possible to have a functionality, where you first press the 
mouse, then shift, then move the mouse.

I don't think shift first, then mouse button, then mouse move can 
be handled like in DPaint. :-/
Because you might move the mouse a bit after shift, before mouse 
button.
It might be doable with the feel function "detect".
Brock
1-Sep-2005
[2437]
Speaking of shift, wasn't the cirlce tool actually an elipse, and 
holding shift created the same x-y offset, same with rectangle tool. 
Shift made a square?
Geomol
2-Sep-2005
[2438x2]
In DPaint IV on my Amiga here, circle and ellipse are 2 tools, and 
shift has no impact, but you're right with rectangle being square, 
when shift is down. Implementing that...
Done. New version uploaded.
Henrik
2-Sep-2005
[2440x2]
tegneprogrammet er dog stadig meget sløvt
whooops, wrong group
Anton
2-Sep-2005
[2442]
Geomol, I don't see why you can't wait for the mouse down before 
deciding on the axis direction. If shift happens to be pressed when 
you get the down event, then you enter "shift-down" mode, and on 
subsequent move events, either shift is pressed, so decide and "quantize" 
to a horizontal/veritcal direction, or not, so allow any direction 
as usual.
Geomol
2-Sep-2005
[2443x2]
Anton, yes, that is a solution, but

being able to have sticky coords at all time is good. Let's say, 
you want to draw a line aligned to another element, but at the other 
side of the screen. Then you first move the pointer to the element, 
press SHIFT, move to other side of screen and start the line. I've 
implemented it via the "detect" function. New version uploaded at 
http://home.tiscali.dk/john.niclasen/canvas/canvas.r

Instructions at: http://home.tiscali.dk/john.niclasen/canvas/canvas.html
It's possible to press or release SHIFT at any time, also e.g. doing 
an ellipse to freeze height or width of ellipse before finishing 
and rotating it.
james_nak
2-Sep-2005
[2445]
OK, where's the Right mouse erase function? : ^)
Geomol
2-Sep-2005
[2446]
Coming up... :-)
Anton
2-Sep-2005
[2447]
Ok, I see. I thought it was trying to be like the dpaint functionality 
as I remember it. Perhaps you can use control for that.
Geomol
2-Sep-2005
[2448x2]
In DPaint, you can use shift at all times aswell, also before clicking 
with mouse.
james_nak, uploaded new version with right-click for drawing black. 
I'll wait with possibility to choose right-click color, until I do 
GUI.
james_nak
2-Sep-2005
[2450]
Thanks. I'll try it right now.
Henrik
2-Sep-2005
[2451]
james, try drawing circles with this version and then try this one: 
http://hmkdesign.dk/rebol/canvas.r

Which one is faster?
james_nak
2-Sep-2005
[2452]
Henrik, the latter is faster. It is most obvious with the draw command 
and very rapid mouse movements.
Henrik
2-Sep-2005
[2453]
do you have fast or slow hardware?
james_nak
2-Sep-2005
[2454x2]
Geomol, the Right click is most familiar! Cool.
1.8 Ghz 512MB and I haven't rebooted Xp in a while.
Henrik
2-Sep-2005
[2456]
then the patch is mostly visible on fast machines...
Geomol
2-Sep-2005
[2457x2]
Henrik, I've implementer your display-canvas, but with 50 FPS as 
the original PAL Amiga.
New version uploaded.
Hmm no good is some cases. Drawing lines sometimes doesn't show the 
end result. I think, some "show canvas" should be forced. I'll check...
Anton
2-Sep-2005
[2459]
Event filtering is difficult. Have you seen Gabriele and Romano's 
work on that ? Look for eat.r  and there is another one too..
Geomol
2-Sep-2005
[2460]
New version uploaded with forced "show canvas" for all but "over" 
functions. Testing needed!
Henrik
2-Sep-2005
[2461]
you could probably force a show canvas every time you receive an 
'up event