Forums > Jitter

insert symbol into gl command

September 15, 2009 | 12:14 pm

Hi

Is there a way to pass a symbol into a message for a gl command similar to passing integers/floats?

If I use three number boxes and a pak into a message like so…

glenable texture, glbindtexture tex1 , gltranslate $1 $2 $3, plane 0.5, gldisable texture

that works how would I insert a different texture each time into this command?

a+
gar


September 15, 2009 | 4:42 pm

May be the last on-line tutorial can help you?

http://www.cycling74.com/story/2009/8/31/131741/594


September 15, 2009 | 4:50 pm

oh, very useful. I’d figured out a workaround using coll for my specific need but this tutorial example seems much more flexible. Thanks for that.

a+
gar


September 16, 2009 | 1:33 pm

I don’t really understand your question though.
Messages handle symbols just like floats/ints? What am i not getting?

– Pasted Max Patch, click to expand. –

September 16, 2009 | 5:37 pm

My question is how do they handle messages as I can’t get them to come into the standard $1-9 variables. I can’t see your patch as I’m on max 4.6 so you’ll need to post a screenshot if you want me to see it.

a+
gar


September 21, 2009 | 8:41 am

Okay, went back in time to check this out, cos I couldn’t remmember how this was in Max4. Below is the patch I posted here, only in Max4, where it doesn’t work, lol.

Note that you can’t send lists in which the first atom is a symbol. Just make sure the first element is some kind of number, and you can add symbols after that. In Max5, this is fixed, that’s why I was wondering why this was an issue at all.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 209 136 58 196617 tex2 2 3 4;
#P flonum 474 88 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 437 88 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 400 88 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ubumenu 338 88 60 196617 0 1 1 0;
#X add Zero;
#X add Uno;
#X add Dos;
#X add Tres;
#X add Cuatro;
#X add Cinco;
#X add Seis;
#X add Siete;
#X prefix_set 0 0 0;
#P newex 338 136 98 196617 pak texture 0. 0. 0.;
#P message 278 136 58 196617 tex1 1 2 3;
#P message 477 136 67 196617 1 tex2 2 3 4;
#B color 14;
#P message 209 172 234 196617 gltranslate $2 $3 $4 , plane 0.5 , glbindtexture $1;
#P newex 209 200 32 196617 print;
#P comment 477 154 47 196617 works…;
#P connect 10 0 2 0;
#P connect 5 0 2 0;
#P connect 9 0 5 3;
#P connect 8 0 5 2;
#P connect 7 0 5 1;
#P connect 6 0 5 0;
#P connect 3 0 2 0;
#P connect 4 0 2 0;
#P connect 2 0 1 0;
#P window clipboard copycount 11;


Viewing 6 posts - 1 through 6 (of 6 total)