multiple lights on an obj.

Nov 24, 2006 at 5:47am

multiple lights on an obj.

Hi,

It could be the tryptophan from the turkey, but I can’t seem to figure
this out.

I’d like to use multiple lights on an obj file. I’d like to be able
to position each light independently of the others and be able to dim
them on/off. You can see where I have hacked part of this from the
tutorials – but I dont really need to use jit.handle the way the
tutorial shows… it’s just for convenience.

Dunno if it matters but I am using max 462 and jitter 162 on a mac
powerbook OSX Tiger – 128 vram

here’s the patch:

max v2;
#N vpatcher 38 94 983 894;
#P origin 0 152;
#P window setfont “Sans Serif” 9.;
#P newex 34 258 48 196617 loadbang;
#P newex 542 407 42 196617 r grid2;
#P newex 456 154 42 196617 r grid1;
#P newex 114 121 42 196617 s grid2;
#P newex 115 94 42 196617 s grid1;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 570 242 80 1441802 unpack f f f;
#P newex 570 219 92 1441802 route position;
#P newex 502 154 304 1441802 jit.gl.handle trees @scale 0.1 @position 1. 1. 1.;
#P window linecount 2;
#P newex 518 178 262 1441802 jit.gl.gridshape trees @automatic 0
@scale 0.05 @color 1 1 1 @position 1. 1. 1.;
#B color 5;
#P flonum 651 273 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 615 273 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 579 273 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 549 496 80 1441802 unpack f f f;
#P newex 549 473 92 1441802 route position;
#P newex 588 406 298 1441802 jit.gl.handle trees @scale 0.1 @position 1 0.5 0;
#P window linecount 2;
#P newex 605 436 262 1441802 jit.gl.gridshape trees @automatic 0
@scale 0.05 @color 1 1 1 @position 1 0.5 0;
#B color 5;
#P flonum 514 526 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 478 526 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 442 526 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P flonum 241 510 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 242 466 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 240 421 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 53 473 75 196617 glenable light2;
#P newex 163 534 167 196617 pak gllight light2 diffuse 0. 0. 0. 0.;
#P newex 364 550 171 196617 pak gllight light2 position 0. 0. 0. 1.;
#P newex 164 490 171 196617 pak gllight light2 ambient 0. 0. 0. 0.;
#P newex 159 445 174 196617 pak gllight light2 specular 0. 0. 0. 0.;
#P flonum 279 262 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 264 214 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 250 168 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 45 288 75 196617 glenable light1;
#P newex 201 287 167 196617 pak gllight light1 diffuse 0. 0. 0. 0.;
#P newex 407 299 171 196617 pak gllight light1 position 0. 0. 0. 1.;
#P newex 186 239 171 196617 pak gllight light1 ambient 0. 0. 0. 0.;
#P newex 169 193 174 196617 pak gllight light1 specular 0. 0. 0. 0.;
#P message 537 681 99 196617 read mushrooms.obj;
#P toggle 734 659 15 0;
#P message 734 680 94 196617 smooth_shading $1;
#P toggle 642 659 15 0;
#P message 642 680 90 196617 lighting_enable $1;
#P newex 642 704 266 196617 jit.gl.model trees @lighting_enable 1
@smooth_shading 1;
#P newex 27 598 91 196617 jit.gl.sketch trees;
#P user jit.fpsgui 11 701 60 196617 0;
#P toggle 117 697 15 0;
#P message 117 716 70 196617 fullscreen $1;
#P newex 117 735 157 196617 jit.window trees @depthbuffer 1;
#P toggle 11 29 15 0;
#P newex 11 48 51 196617 qmetro 2;
#P newex 11 69 74 196617 t b b b b erase;
#P newex 11 672 386 196617 jit.gl.render trees @erase_color 0. 0. 0.
1. @inherit_material 0 @lighting_enable 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P fasten 1 4 0 0 80 151 16 151;
#P connect 1 0 0 0;
#P connect 0 0 7 0;
#P connect 1 1 8 0;
#P fasten 17 0 8 0 412 358 32 358;
#P connect 25 0 8 0;
#P connect 26 0 8 0;
#P connect 24 0 8 0;
#P connect 23 0 8 0;
#P connect 27 0 8 0;
#P fasten 18 0 8 0 206 358 32 358;
#P fasten 16 0 8 0 191 358 32 358;
#P fasten 15 0 8 0 174 358 32 358;
#P fasten 19 0 8 0 50 358 32 358;
#P connect 49 0 19 0;
#P fasten 49 0 27 0 39 468 58 468;
#P fasten 1 2 46 0 48 117 119 117;
#P fasten 1 3 45 0 64 89 120 89;
#P connect 6 0 5 0;
#P connect 5 0 4 0;
#P connect 28 0 23 3;
#P connect 30 0 26 3;
#P connect 29 0 24 3;
#P connect 20 0 15 3;
#P connect 21 0 16 3;
#P connect 28 0 23 4;
#P connect 30 0 26 4;
#P connect 29 0 24 4;
#P connect 20 0 15 4;
#P connect 22 0 18 3;
#P connect 21 0 16 4;
#P connect 30 0 26 5;
#P connect 28 0 23 5;
#P connect 29 0 24 5;
#P connect 20 0 15 5;
#P connect 22 0 18 4;
#P connect 21 0 16 5;
#P connect 22 0 18 5;
#P fasten 37 0 31 0 554 518 447 518;
#P connect 31 0 25 3;
#P connect 32 0 25 4;
#P fasten 37 1 32 0 589 518 483 518;
#P fasten 38 0 17 3 584 292 490 292;
#P connect 33 0 25 5;
#P fasten 39 0 17 4 620 292 516 292;
#P fasten 37 2 33 0 624 518 519 518;
#P fasten 42 0 41 0 507 175 523 175;
#P fasten 47 0 41 0 461 175 523 175;
#P fasten 40 0 17 5 656 292 542 292;
#P fasten 35 0 36 0 593 469 554 469;
#P connect 36 0 37 0;
#P fasten 42 0 43 0 507 215 575 215;
#P connect 43 0 44 0;
#P fasten 44 0 38 0 575 268 584 268;
#P fasten 35 0 34 0 593 430 610 430;
#P fasten 48 0 34 0 547 430 610 430;
#P fasten 44 1 39 0 610 268 620 268;
#P connect 11 0 10 0;
#P fasten 14 0 9 0 542 699 647 699;
#P fasten 10 0 9 0 647 699 647 699;
#P fasten 12 0 9 0 739 699 647 699;
#P fasten 44 2 40 0 645 268 656 268;
#P connect 13 0 12 0;
#P pop;

any help or suggestions are much appreciated.

Bart

#28860
Dec 3, 2006 at 3:16pm

hi bart-

wondering if you had a break through with multiple lights on an obj?

would love to hear what you came up with as i have some maya stuff i’d like to start working with
in a similar way…is it just a matter of naming several instances of a light? (1, 2, 3 etc.)

best
brian

—–Original Message—–
From: jitter-bounces@cycling74.com on behalf of bart woodstrup
Sent: Fri 11/24/2006 12:47 AM
Subject: [jitter] multiple lights on an obj.

Hi,

It could be the tryptophan from the turkey, but I can’t seem to figure
this out.

I’d like to use multiple lights on an obj file. I’d like to be able
to position each light independently of the others and be able to dim
them on/off. You can see where I have hacked part of this from the
tutorials – but I dont really need to use jit.handle the way the
tutorial shows… it’s just for convenience.

Dunno if it matters but I am using max 462 and jitter 162 on a mac
powerbook OSX Tiger – 128 vram

here’s the patch:

max v2;
#N vpatcher 38 94 983 894;
#P origin 0 152;
#P window setfont “Sans Serif” 9.;
#P newex 34 258 48 196617 loadbang;
#P newex 542 407 42 196617 r grid2;
#P newex 456 154 42 196617 r grid1;
#P newex 114 121 42 196617 s grid2;
#P newex 115 94 42 196617 s grid1;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 570 242 80 1441802 unpack f f f;
#P newex 570 219 92 1441802 route position;
#P newex 502 154 304 1441802 jit.gl.handle trees @scale 0.1 @position 1. 1. 1.;
#P window linecount 2;
#P newex 518 178 262 1441802 jit.gl.gridshape trees @automatic 0
@scale 0.05 @color 1 1 1 @position 1. 1. 1.;
#B color 5;
#P flonum 651 273 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 615 273 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 579 273 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 549 496 80 1441802 unpack f f f;
#P newex 549 473 92 1441802 route position;
#P newex 588 406 298 1441802 jit.gl.handle trees @scale 0.1 @position 1 0.5 0;
#P window linecount 2;
#P newex 605 436 262 1441802 jit.gl.gridshape trees @automatic 0
@scale 0.05 @color 1 1 1 @position 1 0.5 0;
#B color 5;
#P flonum 514 526 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 478 526 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 442 526 35 10 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont “Sans Serif” 9.;
#P flonum 241 510 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 242 466 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 240 421 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 53 473 75 196617 glenable light2;
#P newex 163 534 167 196617 pak gllight light2 diffuse 0. 0. 0. 0.;
#P newex 364 550 171 196617 pak gllight light2 position 0. 0. 0. 1.;
#P newex 164 490 171 196617 pak gllight light2 ambient 0. 0. 0. 0.;
#P newex 159 445 174 196617 pak gllight light2 specular 0. 0. 0. 0.;
#P flonum 279 262 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 264 214 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 250 168 35 9 0 2. 2 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 45 288 75 196617 glenable light1;
#P newex 201 287 167 196617 pak gllight light1 diffuse 0. 0. 0. 0.;
#P newex 407 299 171 196617 pak gllight light1 position 0. 0. 0. 1.;
#P newex 186 239 171 196617 pak gllight light1 ambient 0. 0. 0. 0.;
#P newex 169 193 174 196617 pak gllight light1 specular 0. 0. 0. 0.;
#P message 537 681 99 196617 read mushrooms.obj;
#P toggle 734 659 15 0;
#P message 734 680 94 196617 smooth_shading $1;
#P toggle 642 659 15 0;
#P message 642 680 90 196617 lighting_enable $1;
#P newex 642 704 266 196617 jit.gl.model trees @lighting_enable 1
@smooth_shading 1;
#P newex 27 598 91 196617 jit.gl.sketch trees;
#P user jit.fpsgui 11 701 60 196617 0;
#P toggle 117 697 15 0;
#P message 117 716 70 196617 fullscreen $1;
#P newex 117 735 157 196617 jit.window trees @depthbuffer 1;
#P toggle 11 29 15 0;
#P newex 11 48 51 196617 qmetro 2;
#P newex 11 69 74 196617 t b b b b erase;
#P newex 11 672 386 196617 jit.gl.render trees @erase_color 0. 0. 0.
1. @inherit_material 0 @lighting_enable 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P fasten 1 4 0 0 80 151 16 151;
#P connect 1 0 0 0;
#P connect 0 0 7 0;
#P connect 1 1 8 0;
#P fasten 17 0 8 0 412 358 32 358;
#P connect 25 0 8 0;
#P connect 26 0 8 0;
#P connect 24 0 8 0;
#P connect 23 0 8 0;
#P connect 27 0 8 0;
#P fasten 18 0 8 0 206 358 32 358;
#P fasten 16 0 8 0 191 358 32 358;
#P fasten 15 0 8 0 174 358 32 358;
#P fasten 19 0 8 0 50 358 32 358;
#P connect 49 0 19 0;
#P fasten 49 0 27 0 39 468 58 468;
#P fasten 1 2 46 0 48 117 119 117;
#P fasten 1 3 45 0 64 89 120 89;
#P connect 6 0 5 0;
#P connect 5 0 4 0;
#P connect 28 0 23 3;
#P connect 30 0 26 3;
#P connect 29 0 24 3;
#P connect 20 0 15 3;
#P connect 21 0 16 3;
#P connect 28 0 23 4;
#P connect 30 0 26 4;
#P connect 29 0 24 4;
#P connect 20 0 15 4;
#P connect 22 0 18 3;
#P connect 21 0 16 4;
#P connect 30 0 26 5;
#P connect 28 0 23 5;
#P connect 29 0 24 5;
#P connect 20 0 15 5;
#P connect 22 0 18 4;
#P connect 21 0 16 5;
#P connect 22 0 18 5;
#P fasten 37 0 31 0 554 518 447 518;
#P connect 31 0 25 3;
#P connect 32 0 25 4;
#P fasten 37 1 32 0 589 518 483 518;
#P fasten 38 0 17 3 584 292 490 292;
#P connect 33 0 25 5;
#P fasten 39 0 17 4 620 292 516 292;
#P fasten 37 2 33 0 624 518 519 518;
#P fasten 42 0 41 0 507 175 523 175;
#P fasten 47 0 41 0 461 175 523 175;
#P fasten 40 0 17 5 656 292 542 292;
#P fasten 35 0 36 0 593 469 554 469;
#P connect 36 0 37 0;
#P fasten 42 0 43 0 507 215 575 215;
#P connect 43 0 44 0;
#P fasten 44 0 38 0 575 268 584 268;
#P fasten 35 0 34 0 593 430 610 430;
#P fasten 48 0 34 0 547 430 610 430;
#P fasten 44 1 39 0 610 268 620 268;
#P connect 11 0 10 0;
#P fasten 14 0 9 0 542 699 647 699;
#P fasten 10 0 9 0 647 699 647 699;
#P fasten 12 0 9 0 739 699 647 699;
#P fasten 44 2 40 0 645 268 656 268;
#P connect 13 0 12 0;
#P pop;

any help or suggestions are much appreciated.

Bart

#88996

You must be logged in to reply to this topic.