Forums > Jitter

changing color of individual points with jit.gl.sketch

May 10, 2007 | 1:05 am

Hi everyone,

I’m sure this is simple and I’m just overlooking the info somewhere: How do you change an individual point’s color in jit.gl.sketch?

I’m generating a star_field for a 3D navigation patch and only seem to be able to the change the colors of all points at once (with the color message). See patch below. Thanks.

Zachary

——————————

max v2;
#N vpatcher 434 45 913 670;
#P window setfont "Sans Serif" 9.;
#P comment 188 27 262 131137545 Generate bumpy sphererical star field with random emptiness;
#P hidden newex 120 74 45 131137545 t reset b;
#P window setfont "Sans Serif" 14.;
#P message 120 48 56 131137550 RESET;
#B color 12;
#P window setfont "Sans Serif" 9.;
#P comment 290 165 76 131137545 0 = max density;
#P number 297 179 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 283 27 131137545 t i b;
#P newex 208 325 100 131137545 expr ($i1 / 400.) + 0.3;
#P newex 208 304 58 131137545 random 100;
#P newex 222 265 36 131137545 t clear;
#P newex 191 223 30 131137545 sel 0;
#P newex 191 245 41 131137545 urn 360;
#P newex 191 201 116 131137545 random 100;
#P newex 191 403 63 131137545 pack 0. 0. 0.;
#P newex 47 403 63 131137545 pack 0. 0. 0.;
#P message 47 498 69 131137545 point $1 $2 $3;
#P newex 229 136 19 131137545 t 0;
#P toggle 191 48 15 0;
#P newex 191 72 46 131137545 metro 10;
#P message 219 93 14 131137545 0;
#P newex 47 473 63 131137545 pack 0. 0. 0.;
#P number 208 161 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 136 27 131137545 t b i;
#N counter 0 179;
#X flags 0 0;
#P newobj 191 112 67 131137545 counter 0 179;
#P newex 191 369 118 131137545 expr ($i1*3.141593) / 180.;
#P comment 311 370 108 131137545 in degrees / out radians;
#P newex 191 179 48 131137545 uzi 360;
#P comment 357 403 13 131137545 y;
#P comment 257 403 13 131137545 z;
#P newex 47 424 141 131137545 expr ($f3 * cos($f1)) * (sin($f2));
#P newex 191 424 144 131137545 expr ($f3 * cos($f1)) * (cos($f2));
#P newex 338 424 85 131137545 expr $f2 * sin($f1);
#P comment 113 403 13 131137545 x;
#P comment 290 150 127 131137545 Change density of star field;
#P message 207 511 31 131137545 reset;
#P flonum 150 493 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 150 511 51 131137545 radius $1;
#P newex 150 531 163 131137545 jit.gl.handle sphere @depth_enable 1;
#P message 106 519 31 131137545 reset;
#P newex 47 557 89 131137545 jit.gl.sketch sphere;
#B color 5;
#P newex 47 583 147 131137545 jit.window sphere @depthbuffer 1;
#P hidden newex 13 26 47 131137545 loadbang;
#P newex 13 96 43 131137545 jit.qball;
#P number 58 47 35 9 0 0 0 2001 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 13 47 15 0;
#P newex 13 73 55 131137545 metro 20;
#P newex 13 118 47 131137545 t b erase;
#P newex 13 149 87 131137545 jit.gl.render sphere;
#P hidden connect 6 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 1 0;
#P fasten 1 1 0 0 55 141 18 141;
#P connect 1 0 0 0;
#P fasten 23 0 33 0 196 392 52 392;
#P lcolor 13;
#P connect 33 0 18 0;
#P connect 18 0 27 0;
#P connect 27 0 32 0;
#P hidden connect 45 0 8 0;
#P lcolor 2;
#P connect 32 0 8 0;
#P fasten 9 0 8 0 111 547 52 547;
#P fasten 10 0 8 0 155 552 52 552;
#P connect 4 0 2 1;
#P connect 26 0 33 1;
#P fasten 16 0 27 1 343 463 78 463;
#P fasten 40 0 33 2 213 356 104 356;
#P lcolor 7;
#P fasten 17 0 27 2 196 456 104 456;
#P hidden connect 44 0 45 0;
#P connect 12 0 11 0;
#P hidden connect 45 0 10 0;
#P lcolor 2;
#P fasten 13 0 10 0 212 528 155 528;
#P connect 11 0 10 0;
#P fasten 31 0 30 0 234 157 267 157 267 40 196 40;
#P connect 30 0 29 0;
#P connect 29 0 24 0;
#P connect 24 0 25 0;
#P connect 25 0 21 0;
#P connect 21 0 35 0;
#P connect 35 0 37 0;
#P connect 38 0 36 0;
#P connect 37 0 36 0;
#P connect 36 0 41 0;
#P connect 41 0 23 0;
#P connect 23 0 34 0;
#P lcolor 13;
#P connect 34 0 17 0;
#P connect 25 1 26 0;
#P connect 41 1 39 0;
#P connect 39 0 40 0;
#P connect 26 0 34 1;
#P hidden connect 45 1 28 0;
#P lcolor 2;
#P connect 28 0 24 2;
#P connect 36 1 38 0;
#P connect 24 2 31 0;
#P fasten 40 0 34 2 213 356 248 356;
#P lcolor 7;
#P connect 42 0 35 1;
#P fasten 23 0 16 0 196 392 343 392;
#P lcolor 13;
#P fasten 40 0 16 1 213 356 418 356;
#P lcolor 7;
#P pop;


May 10, 2007 | 5:40 am

Figured it out: glcolor


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