GL object inside another object with alphamap "windows"

Apr 3, 2008 at 6:33am

GL object inside another object with alphamap "windows"

If you’ve ever seen one of those carved, wooden balls from Chine where you have a sphere inside a carved sphere inside a sphere; I want tot do something similar in Jitter. Here’s a super basic patch that exhibits the problem I’m having. I can’t seem to come up with the combination of modes to allow depth sensitivity with an alpha cutout. I’d like to be able to see both textures/movies front and back sides as they rotate about the center.

See example patch below:

max v2;
#N vpatcher 385 83 1280 574;
#P origin 7 0;
#P user dial 10 165 40 40 360 1 0 0 159 359 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P user dial 11 218 40 40 360 1 0 0 159 359 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P window setfont “Sans Serif” 9.;
#P number 52 216 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 54 237 103 9109513 pak rotatexyz 90. 0. 0.;
#P window linecount 3;
#P newex 160 211 348 9109513 jit.gl.gridshape orby @shape sphere @automatic 0 @texture orbittext @color 1. 1. 1. 1. @depth_enable 1 @blend_enable 1 @lighting_enable 0 @smooth_shading 1 @tex_map 4 @scale 1. 1. 1. @position 0. 0. 0. @dim 320 240;
#P number 52 167 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 52 185 103 9109513 pak rotatexyz 90. 0. 0.;
#P newex 265 109 408 9109513 jit.rota @boundmode 1 @anchor_x 160 @anchor_y 120 @zoom_x 0.25 @zoom_y 0.3 @interp 1;
#B color 5;
#P user jit.pwindow 323 41 82 62 0 1 0 0 1 0;
#P message 265 43 26 9109513 read;
#P newex 265 132 151 9109513 jit.gl.texture orby @name orbittext;
#P newex 265 63 55 9109513 jit.qt.movie;
#P toggle 108 39 15 0;
#P newex 128 39 58 9109513 qmetro 33.3;
#P newex 128 64 131 9109513 t b b b b b b b b b erase;
#P newex 130 323 181 9109513 jit.window orby @interp 1 @depthbuffer 1;
#P newex 130 299 389 9109513 jit.gl.render orby @depth_enable 1 @blend_enable 1 @erase_color 0 0 0 1 @scale 1. 1. 0.8;
#P window linecount 3;
#P newex 158 158 348 9109513 jit.gl.gridshape orby @shape sphere @automatic 0 @texture orbittext @color 1. 1. 1. 1. @depth_enable 1 @blend_enable 1 @lighting_enable 0 @smooth_shading 1 @tex_map 4 @scale 1. 1. 1. @position 0. 0. 0.02 @dim 320 240;
#P window linecount 1;
#P comment 70 39 100 9109513 1.Metro;
#P comment 250 26 100 9109513 2.load movie;
#P comment 9 146 100 9109513 Rotate objects;
#P connect 20 0 15 0;
#P connect 19 0 18 0;
#P connect 15 0 14 2;
#P connect 18 0 17 2;
#P connect 8 0 7 0;
#P connect 7 0 6 0;
#P connect 6 0 4 0;
#P connect 6 9 4 0;
#P connect 6 1 3 0;
#P connect 14 0 3 0;
#P connect 17 0 16 0;
#P connect 6 2 16 0;
#P connect 11 0 9 0;
#P connect 6 8 9 0;
#P connect 9 0 13 0;
#P connect 13 0 10 0;
#P connect 9 0 12 0;
#P pop;

#36707
Apr 3, 2008 at 6:00pm

Switched to using “Sketch” instead of gridshape, and it just works as I would expect. I still don’t understand why the other method generates such a mess, but I guess I’ll just stop using gridshape for that sort of thing.

Sketch example below:

max v2;
#N vpatcher 385 83 1280 574;
#P origin 7 0;
#P window setfont “Sans Serif” 9.;
#P flonum 59 229 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 119 228 40 9109513 slide;
#P flonum 59 166 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 99 166 40 9109513 slide;
#P button 476 49 15 0;
#P newex 475 81 45 9109513 loadbang;
#P newex 50 372 43 9109513 qlim 100;
#N counter 1 0 360;
#X flags 0 0;
#P newobj 137 389 73 9109513 counter 1 0 360;
#N counter 0 0 360;
#X flags 0 0;
#P newobj 135 361 73 9109513 counter 0 0 360;
#P message 474 219 231 9109513 sphere 0.99 60 120 70 110 , sphere 0.99 240 300 70 110;
#P message 469 393 29 9109513 reset;
#P window linecount 3;
#P newex 168 222 303 9109513 jit.gl.sketch orby @automatic 0 @texture orbittext @color 1. 1. 1. 1. @depth_enable 1 @blend_enable 1 @lighting_enable 1 @smooth_shading 1 @tex_map 4 @scale 1. 1. 1. @position 0. 0. 0.02;
#P window linecount 1;
#P message 473 156 221 9109513 sphere 1. 60 120 70 110 , sphere 1. 240 300 70 110;
#P user dial 10 165 40 40 360 1 0 0 159 359 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P user dial 11 218 40 40 360 1 0 0 159 359 1 1. 170 170 170 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P newex 57 252 103 9109513 pak rotatexyz 90. 0. 0.;
#P newex 58 188 103 9109513 pak rotatexyz 90. 0. 0.;
#P user jit.pwindow 323 41 82 62 0 1 0 0 1 0;
#P message 265 43 26 9109513 read;
#P newex 265 132 151 9109513 jit.gl.texture orby @name orbittext;
#P newex 265 63 55 9109513 jit.qt.movie;
#P toggle 108 39 15 0;
#P newex 128 39 58 9109513 qmetro 33.3;
#P newex 128 64 131 9109513 t b b b b b b b b b erase;
#P newex 171 327 220 9109513 jit.window orby @interp 1 @depthbuffer 1 @fsaa 1;
#P newex 168 279 507 9109513 jit.gl.render orby @depth_enable 1 @blend_enable 1 @erase_color 0 0 0 1 @scale 1. 1. 0.8 @light_position 0. 0. 1. 0.25;
#P window linecount 3;
#P newex 167 157 303 9109513 jit.gl.sketch orby @automatic 0 @texture orbittext @color 1. 1. 1. 1. @depth_enable 1 @blend_enable 1 @lighting_enable 1 @smooth_shading 1 @tex_map 4 @scale 1. 1. 1. @position 0. 0. 0.02;
#P window linecount 1;
#P comment 70 39 100 9109513 1.Metro;
#P comment 250 26 100 9109513 2.load movie;
#P comment 9 146 100 9109513 Rotate objects;
#P connect 21 0 16 0;
#P connect 22 0 15 0;
#P connect 6 3 23 0;
#P connect 16 0 27 0;
#P connect 15 0 29 0;
#P connect 27 0 26 0;
#P connect 29 0 28 0;
#P connect 28 0 14 2;
#P connect 26 0 13 2;
#P connect 8 0 7 0;
#P connect 7 0 6 0;
#P connect 23 0 21 0;
#P connect 23 0 22 0;
#P connect 19 0 3 0;
#P connect 6 1 3 0;
#P connect 13 0 3 0;
#P connect 17 0 3 0;
#P connect 19 0 18 0;
#P connect 6 2 18 0;
#P connect 14 0 18 0;
#P connect 20 0 18 0;
#P connect 6 0 4 0;
#P connect 6 9 4 0;
#P connect 6 8 9 0;
#P connect 11 0 9 0;
#P connect 9 0 10 0;
#P connect 9 0 12 0;
#P connect 24 0 17 0;
#P connect 24 0 20 0;
#P connect 25 0 24 0;
#P pop;

#126107

You must be logged in to reply to this topic.