Iterative text display

Aug 6, 2006 at 11:00am

Iterative text display

#27052
Aug 7, 2006 at 4:03pm

#81484
Aug 7, 2006 at 4:45pm

Hi Jose,

First of all thanks for your help; I reply below.

On 7 Aug 2006, at 17:03, jose manuel berenguer wrote:

> does this help you?

Your patch does indeed create a newline per instance, however:

-Because of the truncation in jit.concat, I can’t see how I would
implement a case whereby a newline needs to happen, as opposed to a
newline everytime. (what I need is to draw zeroes every second, to
the edge of the screen, then newline).

-Everything out of jit.concat comes with a type declaration
preceding it. So, I don’t get 0, but ‘int 0′.

I’ve just tried this with a javascript object, but even though I can
print a 0 every second on a jit.gl.text2d window, the newline
character in javascript (n), doesn’t seem to actually give me a
newline.

I tried with the following code:

var tsk = new Task(zeros, this); // our main task

var zero = 0

function zerosTicker(v) {

var zeroscreen = 5
var one = 1
var newline = “0n”

if (typeof v == “number”) {
if (tsk.iterations == 10) {
outlet(0, newline);
}
else {
tsk.interval = 100;
tsk.repeat(10);
}
} else {
outlet(0, one);
tsk.cancel();
}
}

function zeros() {
outlet(0, zero);
}

function stop()
{
tsk.cancel();
}

Can anyone give me advice on where I might look next?

Thanks,

David

> max v2;
> #N vpatcher 236 44 600 669;
> #P origin 4 39;
> #P window setfont “Sans Serif” 9.;
> #P window linecount 1;
> #P message 150 324 66 196617 set $1 , bang;
> #P newex 216 392 45 196617 r limpia;
> #P newex 50 323 95 196617 expr ($i1- 1) * -1;
> #P window linecount 3;
> #P message 151 232 104 196617 ; condition_reached 0 ; limpia bang;
> #P window linecount 2;
> #P message 50 231 100 196617 ; condition_reached 1;
> #P window linecount 1;
> #P newex 50 290 99 196617 r condition_reached;
> #P toggle 50 347 15 0;
> #P newex 151 204 48 196617 loadbang;
> #P newex 50 373 64 196617 metro 1000;
> #P button 216 431 15 0;
> #P newex 216 460 55 196617 jit.matrix;
> #P newex 78 525 55 196617 jit.matrix;
> #P newex 50 428 58 196617 sprintf %d;
> #P newex 50 560 245 196617 jit.gl.text2d zeros @position 0. 0.5
> @color 1. 1. 1. 1.;
> #P newex 50 501 176 196617 jit.concat @concatdim 1 @truncate 1;
> #P newex 50 450 95 196617 jit.str.fromsymbol;
> #P message 165 120 68 196617 fullscreen $1;
> #P toggle 165 97 15 0;
> #P newex 165 150 86 196617 jit.window zeros;
> #P user jit.fpsgui 45 142 60 196617 0;
> #P newex 45 77 43 196617 jit.qball;
> #P newex 45 97 50 196617 t b erase;
> #P toggle 45 34 15 0;
> #P newex 45 56 58 196617 metro 100;
> #P newex 45 120 93 196617 jit.gl.render zeros;
> #P message 50 401 14 196617 1;
> #P comment 234 431 100 196617 < ---clear text;
> #P connect 4 0 3 0;
> #P connect 3 0 6 0;
> #P connect 6 0 5 0;
> #P fasten 5 1 2 0 90 117 50 117;
> #P connect 5 0 2 0;
> #P connect 2 0 7 0;
> #P connect 21 0 24 0;
> #P connect 24 0 20 0;
> #P connect 20 0 18 0;
> #P fasten 26 0 1 0 155 396 55 396;
> #P connect 18 0 1 0;
> #P connect 1 0 14 0;
> #P connect 14 0 11 0;
> #P connect 16 0 12 0;
> #P connect 11 0 12 0;
> #P connect 12 0 13 0;
> #P connect 12 0 15 0;
> #P connect 21 0 26 0;
> #P connect 19 0 23 0;
> #P connect 9 0 10 0;
> #P connect 10 0 8 0;
> #P connect 25 0 17 0;
> #P connect 17 0 16 0;
> #P connect 16 0 12 1;
> #P fasten 15 0 12 1 83 550 245 550 245 496 221 496;
> #P pop;
>
>
> jose manuel berenguer
> jmbeal@telefonica.net +34932857046 +34696538403. http://
> http://www.sonoscop.net/jmb/
> jmberenguer@sonoscop.net +34933064128. http://www.sonoscop.net/
> caos->sonoscop. cccb. montalegre, 5. 08001 barcelona
> spain
>
>

#81485
Aug 7, 2006 at 6:09pm

#81486
Aug 7, 2006 at 7:01pm

#81487
Aug 8, 2006 at 9:48am

Hi!

On 7 Aug 2006, at 19:09, jose manuel berenguer wrote:

>> -Everything out of jit.concat comes with a type declaration
>> preceding it. So, I don’t get 0, but ‘int 0′.
>
> sorry! didn’t realize this from your first message … despite of
> the following isn’t a really elegant solution, it works as you
> describe…

It may not be elegant, but it just saved my butt ;-)

It’s exactly what I was looking for. For the benefit of future Google
searches, I was unable to give n in javascript to opengl, and it
looks like ‘cr’ from a textfile is a much saner solution, and less
work. This is in reference to earlier jit.gl.text2d queries on how to
achieve multiple lines or newline.

Thanks Jose! I owe you a beer next time I’m in Barna.

Best,

David

#81488
Aug 22, 2006 at 3:37pm

#81489

You must be logged in to reply to this topic.