XML Feeds

.

[jitter] Re: Re: Obj files in displaylist?

MarkDavid Hosale markdavid at mdhosale.com
Mon Jul 2 16:31:22 MDT 2007


I haven't been following this thread closely, so apologies if someone  
has covered this already. But, perchance, are you looking for  
something like this?
With this patch you should only need one gl.model instance for each  
model...
For reference: there are several example files that show this technique:
examples->jitter-examples->render:
jit.gl.videoplane-multi.pat (this patch is based on this one)
jit.gl.texture.multi.pat
jit.gl.render.multitetra.pat
jit.gl.render.multi-iter.pat
Hope this is what you're looking for.
-MarkDavid

max v2;
#N vpatcher 597 176 1496 964;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 254 116 48 196617 loadbang;
#P message 254 138 73 196617 read apple.obj;
#P window linecount 3;
#P comment 150 501 208 196617 since we're not using it \, we're  
turning off the depth buffer to conserve VRAM. the default is off \,  
but not harm in being explicit.;
#P comment 453 391 183 196617 turn automatic off. this prevents the  
object from rendering automatically when jit.gl.render is banged;
#P user jit.fpsgui 18 551 60 196617 0;
#P window linecount 4;
#P comment 307 185 201 196617 for each instance you wish to draw you  
need to send a sequence of messages specifying rotation/scale/ 
position of that instance \, and *then* bang;
#P flonum 558 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 596 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 712 257 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 646 282 109 196617 pack scale 0.1 0.1 0.1;
#P newex 526 282 115 196617 pack position 0.5 0.5 0.;
#P newex 511 217 40 196617 t b b b;
#P newex 511 183 38 196617 r obj2;
#P flonum 298 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 336 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 450 258 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 384 282 109 196617 pack scale 0.3 0.3 0.3;
#P newex 274 282 103 196617 pack position 0. 0. 0.;
#P newex 259 217 40 196617 t b b b;
#P newex 259 183 38 196617 r obj1;
#P newex 33 215 38 196617 s obj2;
#P newex 48 193 38 196617 s obj1;
#P newex 233 77 44 196617 r model;
#P newex 63 174 44 196617 s model;
#P message 65 401 85 196617 rect 0 0 640 480;
#P toggle 54 469 15 0;
#P message 54 490 45 196617 ortho \$1;
#P toggle 244 422 15 0;
#P message 244 440 55 196617 floating \$1;
#P hidden message 51 383 68 196617 camera 0 0 4;
#P toggle 171 422 15 0;
#P newex 132 421 35 196617 sel 27;
#P message 171 440 68 196617 fullscreen \$1;
#P newex 89 464 145 196617 jit.window foo @depthbuffer 0;
#P newex 87 421 40 196617 key;
#P newex 18 96 43 196617 jit.qball;
#P number 63 47 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 18 47 15 0;
#P newex 18 73 55 196617 metro 20;
#P newex 18 127 73 196617 t b b b b erase;
#P newex 233 350 307 196617 jit.gl.model foo @automatic 0  
@depth_enable 0 @lighting_enable 1;
#P newex 18 527 80 196617 jit.gl.render foo;
#P comment 99 130 117 196617 important \, erase first;
#P window linecount 4;
#P comment 452 435 183 196617 If you want to use a "painters  
algorithm" for drawing these shapes or perfom alpha blending between  
frames \, don't use depth testing;
#P window linecount 1;
#P comment 20 28 174 196617 • based on jit.gl.videoplane-multi.pat;
#P connect 7 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 5 0;
#P fasten 5 4 3 0 83 155 113 155 113 252 23 252;
#P connect 5 0 3 0;
#P fasten 18 0 3 0 59 516 23 516;
#P hidden fasten 15 0 3 0 56 448 23 448;
#P connect 3 0 40 0;
#P connect 5 1 24 0;
#P connect 5 2 23 0;
#P connect 19 0 18 0;
#P connect 8 0 6 1;
#P connect 5 3 21 0;
#P fasten 12 0 11 0 176 459 94 459;
#P fasten 16 0 11 0 249 459 94 459;
#P fasten 20 0 11 0 70 449 94 449;
#P fasten 10 0 13 0 92 440 129 440 129 419 137 419;
#P fasten 13 0 14 0 137 439 168 439 168 419 176 419;
#P connect 14 0 12 0;
#P fasten 35 0 4 0 651 340 238 340;
#P fasten 34 0 4 0 531 330 238 330;
#P fasten 33 0 4 0 516 323 238 323;
#P fasten 28 0 4 0 389 315 238 315;
#P fasten 27 0 4 0 279 309 238 309;
#P fasten 26 0 4 0 264 302 238 302;
#P fasten 43 0 4 0 259 164 238 164;
#P connect 22 0 4 0;
#P connect 17 0 16 0;
#P connect 44 0 43 0;
#P connect 25 0 26 0;
#P connect 26 1 27 0;
#P fasten 31 0 27 1 303 277 310 277;
#P connect 30 0 27 2;
#P fasten 26 2 28 0 294 245 389 245;
#P connect 29 0 28 1;
#P connect 29 0 28 2;
#P connect 29 0 28 3;
#P connect 32 0 33 0;
#P connect 33 1 34 0;
#P fasten 38 0 34 1 563 280 566 280;
#P connect 37 0 34 2;
#P fasten 33 2 35 0 546 248 651 248;
#P connect 36 0 35 1;
#P connect 36 0 35 2;
#P connect 36 0 35 3;
#P pop;


On Jul 2, 2007, at 1:29 PM, Bruno Zamborlin wrote:

> What I would like to to is to display more 3D identical objects  
> loading only one OBJ file...
> --
> Bruno




More information about the jitter mailing list