Forums > Jitter

mutiple render contexts and camera

February 11, 2006 | 10:44 pm

Hi list,

A few weeks ago we investigated the best way to use multiple fullscreen outputs.

The best way to deal with this is using multiple context doing the
same things in stead of one context and switching renders.

When using this some other fine tuning is aquired when wanting to
transform in the z axis.
I prepared a patch for testing and maybe posting solutions.

I already tried lookat & lens_angle but I couldn’t get my mind around
it that way.

In the example patch I moved the second render with -2.15 0. 0. so
logically I thought the camera needs to look at -2.15 0. 2. (Actually,
just moving works fine when not using the z)

When I however turn in z using the handles, the screens do not align
anymore. Does anybody has any hints how to counter that?

Thnx

M

max v2;
#N vpatcher 176 125 1187 789;
#P window setfont "Sans Serif" 9.;
#P window linecount 9;
#P comment 51 411 150 196617 When I want to render a landscape on two
different windows , it works perfectly. I can position x and y
wihtout a problem. However when I want to transform in the z direction
the two windows doesn’t match up anymore. How do I counter that?;
#P window linecount 1;
#P newex 495 194 52 196617 r texture;
#P newex 279 201 52 196617 r texture;
#P newex 753 119 52 196617 s texture;
#P message 803 77 30 196617 read;
#P newex 753 76 45 196617 r movie;
#P newex 196 167 45 196617 s movie;
#P newex 753 100 63 196617 jit.qt.movie;
#P newex 265 226 125 196617 jit.gl.videoplane context2;
#P newex 128 138 50 196617 t b erase;
#P message 460 55 34 196617 reset;
#P newex 265 121 208 196617 jit.gl.handle context2 @inherit_transform 1;
#P newex 265 278 54 196617 r render2;
#P newex 265 306 207 196617 jit.gl.render context2 @position -2.15 0. 0.;
#P newex 483 121 208 196617 jit.gl.handle context1 @inherit_transform 1;
#P newex 60 167 54 196617 s render2;
#P newex 60 138 50 196617 t b erase;
#P newex 60 103 147 196617 t b b b;
#P newex 128 167 54 196617 s render1;
#P toggle 60 57 15 0;
#P newex 60 79 51 196617 qmetro 1;
#P newex 483 278 54 196617 r render1;
#P newex 483 226 125 196617 jit.gl.videoplane context1;
#P newex 265 352 173 196617 jit.window context2 @depthbuffer 1;
#P newex 483 306 108 196617 jit.gl.render context1;
#P newex 483 352 173 196617 jit.window context1 @depthbuffer 1;
#P comment 50 396 100 196617 Problem:;
#P connect 7 0 6 0;
#P connect 6 0 9 0;
#P connect 9 0 10 0;
#P fasten 10 0 11 0 65 161 65 161;
#P fasten 10 1 11 0 105 161 65 161;
#P fasten 9 1 17 0 133 129 133 129;
#P fasten 17 1 8 0 173 161 133 161;
#P fasten 17 0 8 0 133 161 133 161;
#P connect 9 2 20 0;
#P fasten 16 0 15 0 465 95 270 95;
#P connect 12 0 18 0;
#P lcolor 6;
#P connect 24 0 18 0;
#P connect 15 0 18 0;
#P lcolor 6;
#P connect 14 0 13 0;
#P fasten 16 0 12 0 465 95 488 95;
#P connect 15 0 4 0;
#P lcolor 6;
#P connect 12 0 4 0;
#P lcolor 6;
#P fasten 25 0 4 0 488 225;
#P connect 5 0 2 0;
#P fasten 22 0 19 0 808 96 758 96;
#P connect 21 0 19 0;
#P connect 19 0 23 0;
#P pop;


February 12, 2006 | 10:34 pm

Little update,

It is offcourse obvious that this works in this way.

Imagine you got this view from above:

X /
/ /
–.–.–

Where "."‘s are camera’s with an angle of 45 degrees
"/" and "" indicates where the viewing edges are of those camera’s

X marks the crossing point of those lines. Then all behaviour is explained, what i however want to reach is this
| | |
| | |
–.–.–

Where the two camera’s look straight ahead and do not cross each others path of viewing.

Is there a way to accomplish this?

Thnx


February 12, 2006 | 10:49 pm

Hi Maarten,

All I can say is you have to transform the position and rotation of one
camera in relation to the other. I started a tread about stuff like this
because basically want to do the same, but with an object in relation to the
camera. I started working on it, but got stuck and haven’t found the time
and courage to get my head around it since then. You can check out
the topic here.

http://www.cycling74.com/forums/index.php?t=msg&goto=619 38&r id=0&srch=3d+coordinate#msg_61938

hth, grt T_


February 12, 2006 | 10:51 pm

There’s a type of lens out there that doesn’t cary depth information
in the final image. I think it might do something close to what you
describe, but I can’t for the life of me remember what that type of
lens was called. I tried searching for othogonal lens and didn’t turn
anything up. I believe this type of lens is used by computer vision
people most often because of the unique properties of the image.

Of course, I could be constructing a memory from nothing and this
could all be lies. But for some reason, I have this idea of a type of
lens that distorts the image in such a way that apparent depth is
lost.

wes


February 12, 2006 | 10:53 pm

> what i however want to reach is this
> | | |
> | | |
> –.–.–

i’ have not tried this, but what your are suggesting seems to be
orthographic. see the @ortho attribute of jit.gl.render

another thought,
what if you had two cameras with angles of 22.5 each with their
adjacent edges/clipping planes aligned.. something like:

| /
| /
| /
|/
—-.—-

just brainstorming,, :)

-jonathan


February 12, 2006 | 10:59 pm

Whoops, I thought you were talking about real cameras.

wes


February 12, 2006 | 11:01 pm

i’m using the command ortho 0/1/2 for an orthogonal viewport
projection. 0=off, 1/2=different versions of ortho, i forgot what
exactly.

best, d.

_____ dominik busch

___dmnk@mufor.com
_____ http://www.v–lab.net


February 12, 2006 | 11:05 pm

ps ortho applies to the render object
d.

_____ dominik busch

___dmnk@mufor.com
_____ http://www.v–lab.net


February 12, 2006 | 11:17 pm

I just tried Ortho, forgot the function existed. :)

it seems to get rid of some of the cludder or messiness but it doesn’t
align properly.
Maybe using Ortho with some rotation or camera functions will do the trick.

Thijs thnx for the link, I will look into it.

Thnx for pointing out ortho and for getting me some steps closer.


February 12, 2006 | 11:19 pm

In reply to Jonathan placing them in one point hint.

I’m actually not using two but more camera’s if you get more you will
eventually make circle I think.


February 12, 2006 | 11:43 pm

Well I made it work with the example patch in my first post. However I
offcourse loose the z axis in the process. So I will have to do some
testing how to solve that when using multiple objects. I guess I will
have use scaling instead of z positioning

It will do for the given patch, it is however a simplification of a
more complex patch.
Thnx for pointing out Ortho, I forgot it was there.

Grtz,

Maarten


Viewing 11 posts - 1 through 11 (of 11 total)