World: r3wp
[View] discuss view related issues
older newer | first last |
Maxim 24-May-2009 [8866] | so clearly, the rebol event engine is capable of much higher throughput than its allowing. |
Steeve 24-May-2009 [8867x2] | he can but it's a design limit. |
the rate you enter on a face is not taken in account. Time events are always throwed at the same rate. Then there is some internal counter for each face which have a rate value, to know when the time events must be dispatched to them. I don't know if i'm clear... | |
Maxim 24-May-2009 [8869x3] | the rate is taken into account if you set it before opening the window, but cannot be changed after. |
but beyond 5 / second, is progressively gets off by the above percentages. up to a maximum of 15/s when you put it at 24 | |
but I am now building a precise timed function which is taking 1% cpu and can go up to 60 frames/second consistently. | |
Steeve 24-May-2009 [8872] | wrong, it can be, but you must do a refresh on the face, after changing his rate |
Maxim 24-May-2009 [8873] | beyond that and the wait goes into madness mode and consumes 100% (of one core) |
Steeve 24-May-2009 [8874] | What i mean, is that, there is 2 rates. One for the inner event handler which is always the same (the limit you pointed 15 ev/sec) And the rate of the face, wich is basically a counter |
Maxim 24-May-2009 [8875x2] | this might have been fixed in a later view, cause it didn't update before. |
ah ok. | |
Steeve 24-May-2009 [8877x3] | So even if you fix a low rate 1 ev/minutes on a face, The time events continue to be send at a rate of 15 ev/sec in the inner event handler. It can be the reason why it consumes so much time |
i got the problem in area-tc | |
and there is another one problem, It consumes time and memory, you have to to do frequent recycles. | |
Maxim 24-May-2009 [8880x2] | I've never had any memory issues with recycling... do you put recycle to off? |
(when rate is used) | |
Steeve 24-May-2009 [8882] | no, but i saw that when the time rate is activated it consumes memory, some mega, i don't like that |
Maxim 24-May-2009 [8883] | seems the lack of resolution from the /precise flag is the source of the offset in what you ask and what you get. I bet on a linux box, it would be much more precise. |
Anton 24-May-2009 [8884] | Max rate of 15/s sounds a bit low to me. When I was on WinXP it was 48/s maximum rate. |
Maxim 24-May-2009 [8885x6] | if I put rate at or anything above 30 I only ever get 15, and when I do tests with my more precise timing function it seems that by using wait 0.001 I can go at 65 frames / second. ironicaly, rounding and IEEE math errors give me the same 66% - 75% offset between desired rate and actual rate... seems I'm using the same algorythm than REBOL internally. this is on a winxp with 1.5GHz core2 duo. |
(and good nvidia gfx card) | |
I have a strange reaction in some AGG code... calling show on the face is actually appending the new AGG drawing to previous such that the image is the result of all prior draws... but the draw stroke (verified) isn't growing! anyone know what is causing this... AFAFIK I am not using the draw command, but setting the face/effect and calling to-image on the face. | |
DOH! never mind... just found it... I was setting the face/image to that new image ... heheheh obvious. | |
anyone have some spline (bezier, nurbs, anything) math converted to rebol code? I want do to some point on spline stuff, using control vertices to orient the curve. | |
if it has tangent functions for the points that would even be better! | |
Steeve 24-May-2009 [8891] | did you check rebol.org ? |
Maxim 24-May-2009 [8892x2] | yep.. didn't find anything with spline or curve in it... is there something there? |
but I could have done more searching... | |
Steeve 24-May-2009 [8894] | you can"t use draw dialect ? |
Maxim 24-May-2009 [8895x2] | how do I get the x,y coordinate on the curve from a spline I draw with AGG? |
I need the math, the main use isn't for AGG, but it will eventually have to be displayed anyways. | |
Steeve 24-May-2009 [8897x2] | well i've done some smouth functions to interpolates coordinates, but i don't know if it's your need. What is your input and what output are you expecting ? |
you're starting from some points i guess, and you want to construct a smouth curve with them... | |
Maxim 24-May-2009 [8899] | yes... bezier, b-spline, or nurbs, if possible... cause I can easily match them with other applications if I need to eventually. |
Steeve 24-May-2009 [8900x5] | ok, i give you a hint |
i download a script wait... | |
the most common know function (i guess) to interpolate 2 points is to use this cosine function. (1 - cosine a * 180) / 2 | |
i use it in my plasma script | |
a is a value between 0,1 | |
Maxim 24-May-2009 [8905x3] | I know bezier really is just an iterated break up of an algorythm between control points.. I could implement the math, but if you've got some stuff all done ;-) |
all the algorythms are available on the web via siggraph and other sources, but coding that stuff usually isn't very fun. | |
I was asking, cause I saw a demo once of someone rebuilding the AGG spline manually right over the AGG one.. so some code definitely exists. | |
Steeve 24-May-2009 [8908x2] | no, i use it to interpolate colors, not coordinates, so it is no use as it is in my script. But it's easy to figure how to interpolate coordinates instead of colors gradiants, i gues... |
Giving 2 points as input , i can write it if you want, but give me the paremeters you want and the result expected (an image, a block of coordinates ?). Give the specs | |
Maxim 24-May-2009 [8910] | for linear interpolation its pretty easy. this is the complicated use... give me the (x.y) at length z of (bezier, nurbs, quadratic, etc) spline defined by points p1, p2, p3, p4, pn |
Reichart 24-May-2009 [8911] | We wrote our own spline (arc function for a Paint program we did). DPaint had this, which implies John's RPaint has this code too, no? |
Steeve 24-May-2009 [8912x2] | ho i see, your input is a length and you want the coordinates in return ? |
tricky need | |
Reichart 24-May-2009 [8914x2] | The nice thing is that it works backwards, which is, you give it XY, and a control point, and it draws thorugh the control point. |
Of note, if you want another way to think of an arc. Think of drawing 3 points A B C (C is the "pull") Now, you have what looks like a triangle. If you make a tic halfway between A and C, and B and C, and draw a line been these tics, then keep doing this, you will eventually make an Arc. The last tic is where your Mouse cursor would end up. That is why Arc in RPaint is "backwards". Cool, eh? | |
older newer | first last |