Multiple views in one context

Jan 29, 2006 at 9:28pm

Multiple views in one context

I am trying to draw two views of the same OpenGL scene in one frame. The idea is: draw frame, move camera, draw
frame again, output frame. But the results flicker. It’s the same at any speed that the jit.gl.render object is banged.
(See patch below.)

I’m aware that the “correct” way to do this is to have multiple objects, rather than multiple camera views. But
hopefully someone can spot an error in the way I’m trying to accomplish this.
Thanks
Kurt
http://auv-i.COM

http://retnull.com

max v2;
#N vpatcher 285 50 1430 747;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 261 41 26 196617 200;
#P message 231 41 23 196617 20;
#P message 231 210 83 196617 lookat -1. -1. 0.;
#P message 325 188 73 196617 lookat 1. 0. 0.;
#P newex 541 276 145 196617 jit.window foo @depthbuffer 1;
#P number 231 64 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 184 64 15 0;
#P newex 184 90 57 196617 qmetro 20;
#P newex 184 144 200 196617 t b b b b erase;
#P newex 502 227 339 196617 jit.gl.gridshape foo @shape torus @lighting_enable 1 @smooth_shading 1;
#B color 5;
#P newex 184 544 82 196617 jit.gl.render foo;
#P comment 299 58 220 196617 …still flickers , even when banged slowly;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P fasten 8 0 1 0 330 373 189 373;
#P fasten 9 0 1 0 236 384 189 384;
#P fasten 3 4 1 0 377 352 189 352;
#P fasten 2 0 1 0 507 394 189 394;
#P fasten 3 2 1 0 283 352 189 352;
#P connect 3 0 1 0;
#P fasten 11 0 6 0 266 60 236 60;
#P connect 10 0 6 0;
#P connect 6 0 4 1;
#P connect 3 1 9 0;
#P connect 3 3 8 0;
#P pop;

#24155
Jan 29, 2006 at 11:14pm

Am 29.01.2006 um 22:28 schrieb auvi:
> I am trying to draw two views of the same OpenGL scene in one frame.
> The idea is: draw frame, move camera, draw
> frame again, output frame. But the results flicker. It’s the same at
> any speed that the jit.gl.render object is banged.

Hi Kurt,
use @automatic 0 and bang jit.gl.gridshape twice (instead of
jit.gl.render).
cheers, g.

max v2;
#N vpatcher 8 44 1022 741;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P message 261 41 26 196617 200;
#P message 231 41 23 196617 20;
#P message 231 210 83 196617 lookat -1. -1. 0.;
#P message 325 188 73 196617 lookat 1. 0. 0.;
#P newex 541 276 145 196617 jit.window foo @depthbuffer 1;
#P number 231 64 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 184 64 15 0;
#P newex 184 90 57 196617 qmetro 20;
#P newex 184 144 200 196617 t b b b b erase;
#P newex 489 226 400 196617 jit.gl.gridshape foo @shape torus
@lighting_enable 1 @smooth_shading 1 @automatic 0;
#B color 5;
#P newex 184 544 82 196617 jit.gl.render foo;
#P comment 518 211 220 196617 move this to the far left for different
lighting;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P fasten 2 0 1 0 494 394 189 394;
#P connect 3 0 1 0;
#P fasten 3 4 1 0 377 352 189 352;
#P fasten 9 0 1 0 236 384 189 384;
#P fasten 8 0 1 0 330 373 189 373;
#P connect 10 0 6 0;
#P fasten 11 0 6 0 266 60 236 60;
#P connect 6 0 4 1;
#P connect 3 1 9 0;
#P connect 3 3 8 0;
#P connect 3 3 2 0;
#P connect 3 1 2 0;
#P pop;

#69440
Jan 29, 2006 at 11:47pm

hi kurt,

the problem is in:

> draw frame, move camera, draw frame again, output frame.

because draw frame means output frame too, checkout attached patch.

one solution is what georg suggested, another would be to use
jit.gl.sketch…

hth,
nesa

#P button 260 201 15 0;
#P button 241 200 15 0;
#P button 203 200 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 184 129 106 9109513 jit.cycle 5 @mode 1;
#P button 184 200 15 0;
#P message 348 244 31 9109513 erase;
#P button 222 200 15 0;
#P message 259 41 26 9109513 200;
#P message 229 41 23 9109513 20;
#P message 203 244 72 9109513 lookat -1. -1. 0.;
#P message 278 244 66 9109513 lookat 1. 0. 0.;
#P newex 541 276 145 9109513 jit.window foo @depthbuffer 1;
#P number 229 64 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 184 64 15 0;
#P newex 184 90 55 9109513 qmetro 333;
#P newex 502 227 339 9109513 jit.gl.gridshape foo @shape torus
@lighting_enable 1 @smooth_shading 1;
#B color 5;
#P newex 184 512 71 9109513 jit.gl.render foo;
#P comment 299 58 220 9109513 …still flickers , even when banged slowly;
#P connect 4 0 3 0;
#P connect 3 0 14 0;
#P connect 5 0 3 1;
#P connect 17 0 12 0;
#P connect 16 0 7 0;
#P connect 14 4 17 0;
#P connect 14 3 16 0;
#P fasten 10 0 5 0 264 60 234 60;
#P connect 9 0 5 0;
#P fasten 14 2 11 0 227 180 227 180;
#P connect 15 0 8 0;
#P connect 14 1 15 0;
#P fasten 7 0 1 0 283 305 189 305;
#P fasten 8 0 1 0 208 282 189 282;
#P fasten 2 0 1 0 507 394 189 394;
#P fasten 12 0 1 0 353 318 189 318;
#P connect 13 0 1 0;
#P lcolor 15;
#P fasten 11 0 1 0 227 289 189 289;
#P lcolor 15;
#P connect 14 0 13 0;
#P window clipboard copycount 18;

#69441
Jan 30, 2006 at 12:15am

Thanks for your help — I’m glad the solution was so simple

Kurt
http://auv-i.COM

http://retnull.com

#69442

You must be logged in to reply to this topic.