Forums > Jitter

ortho1 overlayed ortho0?

February 21, 2006 | 1:58 am

I am trying to draw graphics on a 2D plane in front of a 3D rendered world. Just like in video games. I would like this control panel to be able to slide in and out, control alpha, etc. but not be effected by the camera perspective of the underlying world. I thought that a jit.gl.videoplane object with ortho 1 would work, but it doesn’t. How does one do this?

Christopher


February 21, 2006 | 4:39 am

@ortho is a renderer setting. So you will need to disable automatic
mode, send ortho X to jit.gl.render, bang the objects you wish to
draw, then send @ortho Y to jit.gl.render and bang the other objects
you wish to draw.

-Joshua


February 21, 2006 | 5:14 am

I am also rendering multiple view onto a single context using multiple
bangs.
But I receive a flikering screen, how could we enable double-buffering and
swap buffer manually after all rendering finish ?


February 21, 2006 | 5:35 am

you can’t "bang" jit.gl.render multiple times for a single frame.
jit.gl.render’s "bang" method is equivalent to drawclients, swap. You
can just swap with the message "swap". In my message I was suggesting
sending the "bang" message to the jit.gl.objects being drawn. For
these, bang is equivalent to the "draw" message. You will want to
turn the jit.gl objects’ automatic attribute off.

-Joshua


February 21, 2006 | 6:23 pm

So I tried what you suggested, which is attached, but when I change the camera to jit.gl.render in anything but the z-axis the ortho 2 layer is still effected. Did I misinterpret your suggestion?

Christopher

max v2;
#N vpatcher 50 491 990 935;
#P window setfont "Sans Serif" 9.;
#P flonum 231 146 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 194 146 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 157 146 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 134 171 110 196617 pak camera 0. 0. 0.;
#P toggle 710 238 15 0;
#P window linecount 2;
#P message 708 255 50 196617 fullscreen $1;
#P window linecount 1;
#P message 274 144 50 196617 reset;
#P window linecount 3;
#P newex 682 308 193 196617 jit.gl.gridshape testy @shape torus @scale 0.2 @automatic 0 @lighting_enable 1 @blend_enable 1 @depth_enable 1;
#P window linecount 2;
#P newex 274 175 81 196617 jit.gl.handle testy;
#P newex 475 263 81 196617 jit.noise 4 char 32 240;
#P window linecount 1;
#P newex 648 370 113 196617 jit.window testy;
#P message 436 150 50 196617 ortho 2;
#P message 516 150 50 196617 ortho 0;
#P toggle 379 64 15 0;
#P newex 378 83 81 196617 qmetro 5;
#P newex 378 124 219 196617 t b b b b erase;
#P window linecount 3;
#P newex 475 306 201 196617 jit.gl.videoplane testy @automatic 0 @scale 1.33 0.3 @color 1. 1. 1. 0.7 @depth_enable 1 @blend_enable 1;
#P window linecount 2;
#P newex 295 315 158 196617 jit.gl.render testy @automatic 0 @depth_enable 1 @depthbuffer 1;
#P connect 15 0 14 1;
#P connect 16 0 14 2;
#P connect 17 0 14 3;
#P connect 11 0 9 0;
#P connect 14 0 0 0;
#P connect 9 0 0 0;
#P connect 2 0 0 0;
#P connect 2 4 0 0;
#P connect 5 0 0 0;
#P connect 6 0 0 0;
#P connect 4 0 3 0;
#P connect 3 0 2 0;
#P connect 2 1 6 0;
#P connect 2 0 8 0;
#P connect 2 0 1 0;
#P connect 8 0 1 0;
#P connect 2 3 5 0;
#P connect 12 0 7 0;
#P connect 2 2 10 0;
#P connect 13 0 12 0;
#P pop;


February 21, 2006 | 6:51 pm

On Feb 21, 2006, at 10:23 AM, Christopher Overstreet wrote:

>
> So I tried what you suggested, which is attached, but when I change
> the camera to jit.gl.render in anything but the z-axis the ortho 2
> layer is still effected. Did I misinterpret your suggestion?

You simply need to set the camera position for each "layer"–i.e.
something like the following sequence

erase
ortho 2
camera
bang layer 1 objects
ortho 0
camera

bang layer 2 objects
bang or "swap" message to jit.gl.render

-Joshua


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