draw with GL stroke in sketch issue…

Sep 24, 2007 at 8:59pm

draw with GL stroke in sketch issue…

I’ve managed to alter “twine ball” recipe to a nice sort of “ribbon” drawer, using the mouse. However, I’m getting some animated artifacts that I don’t quite understand – I’m hoping for some illumination…
As I draw the ribbon, it jerks and vibrates on occasion. It appears that it’s getting confused as to the orientation on the bends and turns, and will seem to flip the entire ribbon along it’s “spine”.
Is there a way to avoid this or it is just an oddity of trying to animate this stroke drawing?

Peter.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 84 228 86 196617 lighting_enable 1;
#P flonum 115 118 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 78 152 106 196617 erase_color 0 0 0 $1;
#P message 463 346 66 196617 displaylist 1;
#P window linecount 10;
#P comment 678 61 81 196617 ?why does the “ribbon” constantly jerk and flip as it is drawn? it seems like it’s getting confused as to the orientation of “bends” in the curve…;
#P window linecount 1;
#P newex 504 27 75 196617 loadmess 0.06;
#P newex 384 28 66 196617 loadmess 50;
#P comment 540 52 81 196617 stroke thickness;
#P flonum 504 50 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 420 52 81 196617 length of stroke;
#P flonum 384 50 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 336 51 45 196617 z-coord;
#P flonum 300 49 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 326 207 20 196617 t b;
#P message 458 269 108 196617 strokeparam scale $1;
#P newex 515 245 60 196617 loadmess 3;
#P message 442 239 72 196617 line_width $1;
#N vpatcher 492 141 1121 767;
#P origin -165 123;
#P user jit.pwindow 251 325 310 58 0 1 0 0 1 0;
#P user jit.pwindow 250 384 310 58 0 1 0 0 1 0;
#P window setfont “Sans Serif” 9.;
#P flonum 141 490 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 0;
#P message 141 512 73 196617 slide_down $1;
#P flonum 78 490 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 78 512 60 196617 slide_up $1;
#P newex 15 434 172 196617 jit.slide @slide_up 5 @slide_down 5;
#B color 5;
#P newex 0 183 41 196617 r pulse;
#B color 5;
#N comlet length;
#P inlet 47 31 15 0;
#N comlet z;
#P inlet 27 31 15 0;
#P window setfont “Sans Serif” 14.;
#N vpatcher 184 437 539 783;
#P window setfont “Sans Serif” 9.;
#P number 209 120 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 2;
#P newex 135 244 92 196617 scale 0 319 -0.9 0.9;
#B color 5;
#P window linecount 1;
#P newex 150 162 44 196617 sel 319;
#B color 5;
#P toggle 132 82 15 0;
#P newex 134 112 46 196617 metro 1;
#B color 5;
#N counter 0 319;
#X flags 0 0;
#P newobj 130 137 74 196617 counter 0 319;
#B color 5;
#P newex 50 60 41 196617 r pulse;
#P newex 67 155 40 196617 change;
#B color 5;
#P number 106 50 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 70 81 44 196617 qlim 33;
#P newex 87 207 104 196617 scale 0 900 0.5 -0.5;
#B color 5;
#P newex 72 234 54 196617 pack 0. 0.;
#B color 5;
#P newex 68 187 117 196617 scale 0 1440 -0.5 0.5;
#B color 5;
#P newex 60 106 66 196617 mousestate;
#B color 5;
#P outlet 72 256 15 0;
#P connect 5 0 1 0;
#P connect 1 1 7 0;
#P connect 7 0 2 0;
#P connect 8 0 5 0;
#P connect 13 0 3 0;
#P connect 2 0 3 0;
#P connect 3 0 0 0;
#P connect 1 2 4 0;
#P connect 6 0 5 1;
#P connect 4 0 3 1;
#P connect 10 0 9 0;
#P connect 12 0 11 0;
#P connect 11 0 10 0;
#P connect 9 0 13 0;
#P connect 9 0 12 0;
#P connect 9 0 14 0;
#P pop 1;
#P newobj 84 136 69 196622 p mouse;
#P window setfont “Sans Serif” 9.;
#P newex 199 137 21 196617 t 0;
#N comlet dims;
#P outlet 235 469 15 0;
#P number 226 127 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 235 151 27 196617 – 1;
#P window linecount 1;
#P newex 261 242 33 196617 !- 19;
#B color 5;
#P newex 20 329 111 196617 jit.rota @boundmode 2;
#B color 5;
#P message 38 310 64 196617 offset_x $1;
#N comlet stroke coords;
#P outlet 20 469 15 0;
#P message 20 261 50 196617 dim $1 0;
#P newex 176 184 27 196617 t b l;
#P message 176 263 153 196617 setcell $1 0 val $2 $3 $4 , bang;
#P newex 176 241 75 196617 pack 0 0. 0. 0.;
#P newex 20 287 130 196617 jit.matrix 3 float32 100 1;
#N counter 0 0 99;
#X flags 0 0;
#P newobj 176 206 77 196617 counter 0 0 99;
#P comment 263 128 100 196617 length (dim);
#P connect 9 0 19 0;
#P connect 22 0 19 0;
#P connect 20 0 19 0;
#P connect 12 0 6 0;
#P connect 6 0 2 0;
#P fasten 4 0 2 0 181 284 25 284;
#P connect 2 0 9 0;
#P connect 18 0 9 0;
#P connect 8 0 9 0;
#P connect 19 0 7 0;
#P fasten 10 0 8 0 266 309 43 309;
#P connect 21 0 20 0;
#P connect 23 0 22 0;
#P connect 15 0 5 0;
#P connect 5 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P connect 5 1 3 1;
#P connect 12 0 14 0;
#P connect 14 0 1 2;
#P fasten 17 0 12 0 52 124 231 124;
#P connect 12 0 11 0;
#P connect 11 0 13 0;
#P fasten 16 0 3 3 32 236 244 236;
#P connect 11 0 1 4;
#P connect 9 0 24 0;
#P connect 2 0 25 0;
#P fasten 1 0 10 0 181 227 266 227;
#P connect 11 0 10 1;
#P pop;
#P newobj 324 93 94 196617 p mouse&midipen2;
#P hidden newex 15 338 106 196617 bgcolor 200 195 190;
#P newex 555 122 66 196617 loadmess 10;
#P number 557 149 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 16 279 15 0;
#P newex 16 258 35 196617 sel 27;
#P newex 16 238 40 196617 key;
#P newex 16 298 91 196617 prepend fullscreen;
#P message 609 255 108 196617 reset , glcolor 1 1 1 1;
#P message 407 215 106 196617 strokepoint $1 $2 $3;
#P window linecount 2;
#P message 544 204 420 196617 beginstroke line , glenable line_smooth , glpolygonmode front_and_back fill , beginstroke basic3d , strokeparam slices 20 , strokeparam order $1 , strokeparam color 1 0.5 0.5 0.5;
#P window linecount 1;
#P newex 326 128 53 196617 t b l b b;
#P newex 326 171 41 196617 jit.iter;
#P newex 49 110 41 196617 s pulse;
#P message 35 156 34 196617 reset;
#P newex 15 318 190 196617 jit.window demo @fsmenubar 0 @fsaa 1;
#P newex 34 186 264 196617 jit.gl.handle demo @inherit_transform 1 @auto_rotate 1;
#P number 66 37 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 25 37 15 0;
#P objectname render_tog;
#P newex 0 208 269 196617 jit.gl.render demo @blend_enable 1 @erase_color 0 0 0 1;
#P newex 326 316 385 196617 jit.gl.sketch demo @blend_enable 1 @scale 2. 2. 2. @lighting_enable 0 @name wave;
#P newex 25 61 51 196617 qmetro 1;
#P newex 25 83 58 196617 t b b erase;
#P message 344 234 54 196617 endstroke;
#P newex 350 208 44 196617 sel 117;
#P comment 591 145 32 196617 order;
#P connect 40 0 6 0;
#P connect 9 0 6 0;
#P connect 3 0 6 0;
#P fasten 3 2 6 0 78 105 5 105;
#P connect 42 0 6 0;
#P connect 18 0 10 0;
#P fasten 19 0 20 0 21 257 21 257;
#P connect 20 0 21 0;
#P connect 21 0 18 0;
#P connect 7 0 4 0;
#P connect 4 0 3 0;
#P connect 11 0 9 0;
#P connect 3 1 12 0;
#P connect 8 0 4 1;
#P connect 41 0 40 0;
#P connect 30 0 25 0;
#P connect 25 0 14 0;
#P connect 14 1 13 0;
#P connect 13 0 29 0;
#P connect 39 0 5 0;
#P connect 28 0 5 0;
#P connect 26 0 5 0;
#P fasten 17 0 5 0 614 307 331 307;
#P fasten 15 0 5 0 549 287 331 287;
#P fasten 16 0 5 0 412 266 331 266;
#P fasten 2 0 5 0 349 258 331 258;
#P connect 1 0 2 0;
#P connect 13 1 1 0;
#P connect 36 0 32 0;
#P fasten 25 1 1 1 413 124 389 124;
#P fasten 13 0 16 0 331 197 412 197;
#P connect 32 0 25 1;
#P fasten 14 2 26 0 359 168 447 168;
#P connect 27 0 26 0;
#P fasten 29 0 28 0 331 261 463 261;
#P connect 34 0 28 0;
#P connect 37 0 34 0;
#P fasten 14 3 15 0 373 179 549 179;
#P fasten 22 0 15 0 562 170 549 170;
#P connect 23 0 22 0;
#P fasten 14 3 17 0 373 179 614 179;
#P window clipboard copycount 43;

#33795
Sep 26, 2007 at 11:34am

pnyboer skrev:
> I’ve managed to alter “twine ball” recipe to a nice sort of “ribbon” drawer, using the mouse. However, I’m getting some animated artifacts that I don’t quite understand – I’m hoping for some illumination…
> As I draw the ribbon, it jerks and vibrates on occasion. It appears that it’s getting confused as to the orientation on the bends and turns, and will seem to flip the entire ribbon along it’s “spine”.
> Is there a way to avoid this or it is just an oddity of trying to animate this stroke drawing?
Hi Peter,
I’ve had a good look at your patch and couldn’t find the problem, but it
does remind me an awful lot about a a problem I had in a different patch
of mine:

What I was drawing quad-based lines in 3d, also using jit.gl.sketch. The
patch was designed to auto-delete early entries in the cmdlist,
essentially doing the same thing as in the splines example – what
happened whenever part of the cmdlist was deleted looked *exactly* like
the jerkiness of the splines in your patch – the path of the “string”
would be recalculated differently.

Don’t know if this helps, just wanted to show my support, really. Looks
like a really promising patch!

Andreas.

#113086

You must be logged in to reply to this topic.