Two cameras with different view in one 3D environment in Jitter

Nov 2, 2006 at 12:35pm

Two cameras with different view in one 3D environment in Jitter

Hi, all,
Maybe i have mist an tutorial or help file.
Is it possible to have 2 cameras with different view in one 3D environment in Jitter?

And each view of each camera is visible on seperated jit.window, so 2 jit.window’s with the same 3D environment.

Grzz, Bart

#28484
Nov 2, 2006 at 3:36pm

I assumed this would be possible by rendering the same scene to two render objects. But when I tried (see the patch below), it didn’t work. Does someone know why this patch doesn’t work? Funny is that when I disconnect the pink patch cord (between drawto and gridshape), suddenly it works.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 82 88 60 196617 loadmess 1;
#P newex 282 90 85 196617 r renderSceneTo;
#P newex 94 149 85 196617 s renderSceneTo;
#P newex 282 110 27 196617 t b l;
#P newex 446 188 87 196617 jit.gl.handle rnd2;
#P newex 299 130 80 196617 prepend drawto;
#P toggle 65 88 15 0;
#P newex 65 108 57 196617 qmetro 40;
#P newex 356 188 87 196617 jit.gl.handle rnd1;
#P newex 244 306 154 196617 jit.window rnd2 @depthbuffer 1;
#P newex 244 286 169 196617 jit.gl.render rnd2 @camera 0. 0. 3.;
#P newex 65 128 98 196617 t b rnd2 rnd1 erase;
#P newex 282 169 378 196617 jit.gl.gridshape @automatic 0 @shape plane @color 0. 0. 1. @rotatexyz 0. 24. 54.;
#P newex 65 306 154 196617 jit.window rnd1 @depthbuffer 1;
#P newex 65 286 169 196617 jit.gl.render rnd1 @camera 0. 0. 3.;
#P connect 9 0 2 0;
#P lcolor 15;
#P connect 11 1 9 0;
#P connect 11 0 2 0;
#P connect 10 0 2 0;
#P connect 6 0 2 0;
#P connect 13 0 11 0;
#P fasten 3 0 4 0 70 259 249 259;
#P fasten 3 3 0 0 157 259 70 259;
#P fasten 3 3 4 0 157 259 249 259;
#P connect 3 2 12 0;
#P connect 3 1 12 0;
#P connect 3 0 0 0;
#P connect 7 0 3 0;
#P connect 8 0 7 0;
#P connect 14 0 8 0;
#P window clipboard copycount 15;

Cheers,
Mattijs

#87496
Nov 2, 2006 at 3:43pm

Oh excuse me, this is on Max 4.5.7, Jitter 1.5.2, Mac OS 10.4.8

#87497
Nov 2, 2006 at 6:02pm

matthijs,
I made a few quick changes to your patch and now it seems to do what
you intended.
HtH
-jennek

max v2;
#N vpatcher 231 323 1121 788;
#P window setfont “Sans Serif” 9.;
#P newex 283 154 85 196617 s renderSceneTo;
#P newex 251 126 74 196617 t b rnd2 erase;
#P newex 82 56 60 196617 loadmess 1;
#P newex 433 89 85 196617 r renderSceneTo;
#P newex 97 156 85 196617 s renderSceneTo;
#P newex 433 109 27 196617 t b l;
#P newex 450 129 80 196617 prepend drawto;
#P toggle 65 56 15 0;
#P newex 65 76 57 196617 qmetro 40;
#P newex 244 306 154 196617 jit.window rnd2 @depthbuffer 1;
#P newex 244 286 169 196617 jit.gl.render rnd2 @camera 0. 0. 5.;
#P newex 65 128 74 196617 t b rnd1 erase;
#P newex 432 168 378 196617 jit.gl.gridshape @automatic 1 @shape
plane @color 0. 0. 1. @rotatexyz 0. 24. 54.;
#P newex 65 306 154 196617 jit.window rnd1 @depthbuffer 1;
#P newex 65 286 169 196617 jit.gl.render rnd1 @camera 0. 0. 3.;
#P newex 277 250 87 196617 jit.gl.handle rnd2;
#P newex 110 249 87 196617 jit.gl.handle rnd1;
#P connect 14 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 5 0;
#P connect 0 0 2 0;
#P connect 5 0 2 0;
#P connect 5 2 2 0;
#P connect 5 1 12 0;
#P connect 1 0 6 0;
#P connect 15 0 6 0;
#P connect 15 2 6 0;
#P fasten 8 0 15 0 70 102 256 102;
#P connect 15 1 16 0;
#P connect 10 0 4 0;
#P connect 11 0 4 0;
#P connect 13 0 11 0;
#P connect 11 1 10 0;
#P pop;

On 2-nov-2006, at 14:36, Mattijs Kneppers wrote:

>
> I assumed this would be possible by rendering the same scene to two
> render objects. But when I tried (see the patch below), it didn’t
> work. Does someone know why this patch doesn’t work? Funny is that
> when I disconnect the pink patch cord (between drawto and
> gridshape), suddenly it works.
>8
> Cheers,
> Mattijs

#87498
Nov 2, 2006 at 7:35pm

Ah, I see. Thanks for the modifications Jennek. So it seems there is a problem with automatic 0 then? Trying to narrow this down, I’ll make it two replies.

First: the way to do rendering of one scene on multiple windows would be like this:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 370 28 133 9109513 loadmess rotatexyz 0. 24. 54.;
#P newex 370 50 76 9109513 jit.gl.handle rnd1;
#P newex 448 50 76 9109513 jit.gl.handle rnd2;
#P newex 32 99 85 9109513 s renderSceneTo;
#P newex 11 75 95 9109513 t b rnd2 b rnd1 erase;
#P newex 28 33 60 9109513 loadmess 1;
#P newex 270 28 85 9109513 r renderSceneTo;
#P newex 270 50 80 9109513 prepend drawto;
#P toggle 11 33 15 0;
#P newex 11 53 57 9109513 qmetro 40;
#P newex 11 196 237 9109513 jit.window rnd2 @depthbuffer 1 @rect 360 500 680 740;
#P newex 11 175 308 9109513 jit.gl.render rnd2 @camera 0. 0. 5. @lookat 1.63 0. 0. @lens_angle 27.5;
#P newex 270 73 336 9109513 jit.gl.gridshape @automatic 1 @shape torus @color 0. 0. 1. @lighting_enable 1;
#P newex 54 147 232 9109513 jit.window rnd1 @depthbuffer 1 @rect 40 500 360 740;
#P newex 53 126 311 9109513 jit.gl.render rnd1 @camera 0. 0. 5. @lookat -1.63 0. 0. @lens_angle 27.5;
#P connect 9 0 6 0;
#P connect 6 0 5 0;
#P connect 5 0 10 0;
#P connect 10 4 3 0;
#P connect 10 0 3 0;
#P connect 10 1 11 0;
#P connect 10 3 11 0;
#P connect 10 4 0 0;
#P connect 10 2 0 0;
#P connect 8 0 7 0;
#P connect 7 0 2 0;
#P connect 13 0 2 0;
#P connect 12 0 2 0;
#P connect 14 0 13 0;
#P connect 14 0 12 0;
#P window clipboard copycount 15;

..except for the fact that the perspective is not right.

#87499
Nov 2, 2006 at 7:40pm

Second.. drawto and automatic 0 don’t work together for some reason. Steps to reproduce are in the patch.

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 185 83 56 9109513 loadmess 1;
#P newex 61 51 60 9109513 loadmess 1;
#P toggle 44 51 15 0;
#P newex 44 71 57 9109513 qmetro 40;
#P newex 44 92 74 9109513 t b b rnd1 erase;
#P newex 155 123 27 9109513 !- 1;
#P message 185 123 62 9109513 automatic $1;
#P toggle 185 105 15 0;
#P newex 53 158 29 9109513 gate;
#P newex 89 158 80 9109513 prepend drawto;
#P newex 53 184 350 9109513 jit.gl.gridshape @automatic 1 @shape plane @color 0. 0. 1. @rotatexyz 0. 24. 54.;
#P newex 44 254 154 9109513 jit.window rnd1 @depthbuffer 1;
#P newex 44 231 169 9109513 jit.gl.render rnd1 @camera 0. 0. 3.;
#P newex 97 205 87 9109513 jit.gl.handle rnd1;
#P comment 202 105 302 9109513 setting automatic off (and banging ‘manually’) stops rendering.. why?;
#P connect 7 0 9 0;
#P connect 7 0 8 0;
#P connect 14 0 7 0;
#P connect 10 2 5 0;
#P connect 10 1 6 1;
#P connect 1 0 4 0;
#P fasten 8 0 4 0 190 180 58 180;
#P connect 6 0 4 0;
#P fasten 5 0 4 0 94 180 58 180;
#P fasten 9 0 6 0 160 152 58 152;
#P connect 10 0 2 0;
#P connect 10 3 2 0;
#P connect 11 0 10 0;
#P connect 12 0 11 0;
#P connect 13 0 12 0;
#P window clipboard copycount 15;

I’m curios if anyone can explain this behaviour.

Cheers,
Mattijs

#87500
Nov 2, 2006 at 9:56pm

On 2-nov-2006, at 18:36, Mattijs Kneppers wrote:

> Ah, I see. Thanks for the modifications Jennek. So it seems there
> is a problem with automatic 0 then? Trying to narrow this down,
> I’ll make it two replies.

that surprised me too.
first modification was to make the ‘drawto somerendercontext’ remain
in effect until the somerendercontext is banged.
this makes perfectly sense. when a render context draws, it calls
draw_clients.
drawto establishes that client relationship.

but it did not draw after that modification. changing automatic to 1
was a lucky guess.
I cannot explain.

-jennek

#87501
Nov 3, 2006 at 3:23pm

Two cameras > Two thanks

I gonna check that this works for me.

Grzz,
Bart

#87502
Nov 10, 2006 at 3:17pm

Hi there,

Not a directly Jitter related question but…… I’m learning jitter
and I want to use multiple dv camera (say 4) which I gather isnt
possible. Does anyone know of a composite to firewire converter (for
a mac) so I could plug my cameras into my mixer (edirol v4) then
output that to my laptop. I’ve got a pc with composite video in but I
really want to run this from my laptop.

Any advice would be greatly appreciated

Jack

#87503

You must be logged in to reply to this topic.