jit.gl.sketch maximum messages?

Oct 6, 2008 at 1:18pm

jit.gl.sketch maximum messages?

Hi list,

I’m working on a patch which draws planes using jit.gl.sketch based on some motion tracking using cv.jit.track which allows the user to ‘paint’ with their movement and have a couple of questions.

Is there a maximum number of objects that can be drawn using jit.gl.sketch? After the patch has been running for a few minutes (in which time it will have drawn hundreds of planes) the patch slows down dramatically, hitting reset brings it back up to speed.

Is there a way to clear individual draw commands after a certain time, eg after 200 planes have been drawn begin to erase the oldest as each new one is driven.

Any help or tips would be hugely appreciated, here is a simplified patch with out the motion tracking.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 146 354 45 196617 r metro;
#P newex 146 393 277 196617 jit.gl.render test @depth_enable 0 @erase_color 0. 0. 0. 1.;
#P message 366 431 68 196617 fullscreen $1;
#P toggle 349 431 15 0;
#P newex 313 430 35 196617 sel 27;
#P newex 270 430 40 196617 key;
#P newex 146 452 359 196617 jit.window test @rect 420 420 1020 720 @floating 1 @fsaa 1 @fsmenubar 0;
#P number 116 60 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 114 173 32 196617 sel 1;
#P message 114 88 42 196617 max $1;
#N counter;
#X flags 0 0;
#P newobj 113 147 66 196617 counter;
#P newex 113 119 45 196617 r metro;
#P newex 17 108 45 196617 s metro;
#P number 44 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 17 53 15 0;
#P newex 17 77 42 196617 qmetro;
#P message 123 267 34 196617 reset;
#P message 170 204 153 196617 -0.149967 0.571492 0.;
#P message 170 266 282 196617 glcolor 1. 0.02 0.52 0.15 , point $1 $2 0.2 , plane 0.22 0.4;
#P newex 171 288 295 196617 jit.gl.sketch test @name map @blend_enable 1 @depth_enable 0;
#P window linecount 7;
#P comment 199 110 100 196617 the motion tracking is paked to a list and sent to the message box below and banged from the counter to draw the plane;
#P connect 12 0 3 0;
#P connect 6 0 5 0;
#P connect 5 0 8 0;
#P connect 7 0 5 1;
#P fasten 17 0 18 0 367 446 367 431;
#P hidden connect 16 0 17 0;
#P fasten 15 0 16 0 311 447 311 432;
#P connect 2 0 1 0;
#P connect 4 0 1 0;
#P connect 3 0 2 0;
#P fasten 18 0 14 0 371 451 151 451;
#P connect 20 0 19 0;
#P connect 10 0 12 0;
#P connect 13 0 11 0;
#P connect 11 0 10 0;
#P connect 9 0 10 0;
#P window clipboard copycount 21;

#40172
Oct 6, 2008 at 2:25pm

I don’t know if there’s a maximum number of objects that can be drawn, but
your computer is going to slow down and grind to a halt way before you meet
any limit because it has to do calculations for each object that is being
drawn.
You can use the commands cmd_replace, cmd_insert and cmd_delete with sketch
command lists so you might want to start using the cmd_replace message once
you get to 200 planes.

When you hit reset you are deleting the command list and thus starting again
from 0 planes – that’s why the speed increases again.

pelado

http://www.pelado.co.uk

On Mon, Oct 6, 2008 at 3:18 PM, jack Keenan wrote:

>
> Hi list,
>
> I’m working on a patch which draws planes using jit.gl.sketch based on some
> motion tracking using cv.jit.track which allows the user to ‘paint’ with
> their movement and have a couple of questions.
>
> Is there a maximum number of objects that can be drawn using jit.gl.sketch?
> After the patch has been running for a few minutes (in which time it will
> have drawn hundreds of planes) the patch slows down dramatically, hitting
> reset brings it back up to speed.
>
> Is there a way to clear individual draw commands after a certain time, eg
> after 200 planes have been drawn begin to erase the oldest as each new one
> is driven.
>
> Any help or tips would be hugely appreciated, here is a simplified patch
> with out the motion tracking.
>
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P newex 146 354 45 196617 r metro;
> #P newex 146 393 277 196617 jit.gl.render test @depth_enable 0 @erase_color
> 0. 0. 0. 1.;
> #P message 366 431 68 196617 fullscreen $1;
> #P toggle 349 431 15 0;
> #P newex 313 430 35 196617 sel 27;
> #P newex 270 430 40 196617 key;
> #P newex 146 452 359 196617 jit.window test @rect 420 420 1020 720
> @floating 1 @fsaa 1 @fsmenubar 0;
> #P number 116 60 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 114 173 32 196617 sel 1;
> #P message 114 88 42 196617 max $1;
> #N counter;
> #X flags 0 0;
> #P newobj 113 147 66 196617 counter;
> #P newex 113 119 45 196617 r metro;
> #P newex 17 108 45 196617 s metro;
> #P number 44 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 17 53 15 0;
> #P newex 17 77 42 196617 qmetro;
> #P message 123 267 34 196617 reset;
> #P message 170 204 153 196617 -0.149967 0.571492 0.;
> #P message 170 266 282 196617 glcolor 1. 0.02 0.52 0.15 , point $1 $2
> 0.2 , plane 0.22 0.4;
> #P newex 171 288 295 196617 jit.gl.sketch test @name map @blend_enable 1
> @depth_enable 0;
> #P window linecount 7;
> #P comment 199 110 100 196617 the motion tracking is paked to a list and
> sent to the message box below and banged from the counter to draw the plane;
> #P connect 12 0 3 0;
> #P connect 6 0 5 0;
> #P connect 5 0 8 0;
> #P connect 7 0 5 1;
> #P fasten 17 0 18 0 367 446 367 431;
> #P hidden connect 16 0 17 0;
> #P fasten 15 0 16 0 311 447 311 432;
> #P connect 2 0 1 0;
> #P connect 4 0 1 0;
> #P connect 3 0 2 0;
> #P fasten 18 0 14 0 371 451 151 451;
> #P connect 20 0 19 0;
> #P connect 10 0 12 0;
> #P connect 13 0 11 0;
> #P connect 11 0 10 0;
> #P connect 9 0 10 0;
> #P window clipboard copycount 21;
>
>

#141891
Oct 6, 2008 at 3:19pm

I would create my own system outside of jit.gl.sketch here, but i’m not sure whether there’s an easier method. You should take a look at sending ‘cmd_delete $1′ to sketch, but i imageine the object still has to draw everything again once you delete one command from it’s list. I never used sketch that much, can’t really tell.

Here i draw last 200 planes that are input from a coll. Hope it’s of any help…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 228 168 45 196617 onebang;
#P user jit.fpsgui 139 353 60 196617 0;
#P newex 236 118 46 196617 t l clear;
#P user com 316 58 146 196617 14;
#K set 0 28001 30752 28277 28002 25970 8303 26144 28780 24942 25971 8308 28448 25714 24951;
#K end;
#P newex 139 308 50 196617 t b erase;
#P newex 228 190 67 196617 t dump reset;
#P newex 138 190 68 196617 prepend none;
#P flonum 182 30 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 138 30 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 138 54 54 196617 pack 0. 0.;
#P newex 237 60 72 196617 loadmess 200;
#P newex 236 98 67 196617 prepend max;
#P number 236 80 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N coll ;
#P newobj 138 219 53 196617 coll;
#P window linecount 2;
#P user com 235 30 219 196617 46;
#K set 0 26990 28789 29728 26226 28525 8308 29281 25451 26990 26412 8297 8292 26980 28199 29728 29285 24940 27769 8300 28527 27424 24948 8308 26725 8291 28527 29284 29484 8290 30068 8311 26721 29797 30309 29216 28769 29281 28019 8313 28533 10098 25888 25448 24942 26473 28263;
#K end;
#P window linecount 1;
#P newex 138 85 27 196617 t l b;
#P newex 155 167 62 196617 prepend set;
#P newex 139 284 45 196617 r metro;
#P newex 139 332 277 196617 jit.gl.render test @depth_enable 0 @erase_color 0. 0. 0. 1.;
#P message 362 355 68 196617 fullscreen $1;
#P toggle 345 355 15 0;
#P newex 309 354 35 196617 sel 27;
#P newex 266 354 40 196617 key;
#P newex 141 394 359 196617 jit.window test @rect 420 420 1020 720 @floating 1 @fsaa 1 @fsmenubar 0;
#N counter 200;
#X flags 0 0;
#P newobj 155 145 66 196617 counter 200;
#P newex 228 144 45 196617 r metro;
#P newex 44 85 45 196617 s metro;
#P number 91 30 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 44 30 15 0;
#P newex 44 54 57 196617 qmetro 20;
#P message 138 240 282 196617 glcolor 1. 0.02 0.52 0.15 , point $1 $2 0.2 , plane 0.22 0.4;
#P newex 138 262 295 196617 jit.gl.sketch test @name map @blend_enable 1 @depth_enable 0;
#P connect 16 1 7 0;
#P connect 16 1 31 1;
#P connect 18 0 1 0;
#P connect 31 0 26 0;
#P connect 6 0 31 0;
#P connect 13 0 30 0;
#P connect 3 0 2 0;
#P connect 2 0 5 0;
#P connect 4 0 2 1;
#P connect 20 0 29 0;
#P connect 29 0 7 0;
#P connect 29 1 18 0;
#P connect 7 0 15 0;
#P connect 26 1 0 0;
#P connect 26 0 18 0;
#P connect 27 0 13 0;
#P connect 27 1 13 0;
#P connect 14 0 27 0;
#P connect 16 0 25 0;
#P connect 22 0 16 0;
#P connect 25 0 18 0;
#P connect 15 0 25 0;
#P connect 23 0 22 0;
#P connect 24 0 22 1;
#P connect 21 0 19 0;
#P connect 19 0 20 0;
#P fasten 12 0 8 0 367 389 146 389;
#P connect 1 0 0 0;
#P fasten 9 0 10 0 307 371 307 356;
#P hidden connect 10 0 11 0;
#P fasten 11 0 12 0 363 370 363 355;
#P window clipboard copycount 32;

#141892
Oct 6, 2008 at 3:56pm

Hi, thanks for all the advice, and Bas Van Der Graf thanks for the patch it does exactly what I was trying to work out.

I’m fairly new to gl land and clearly have a lot to learn, but its a hella fun!!

Cheers Guys

JK

#141893

You must be logged in to reply to this topic.