tracking rotation etc in GL

Dec 11, 2006 at 8:40am

tracking rotation etc in GL

if this gets posted twice I’m sorry, think I did something wrong the first time

HI

is there anyway to keep track of a rotation, you trigger by using jit.gl.handle on a world?

I want to have a videoplane running fullscreen that counterRotates in function of the world, so that it always remains more or less fullscreen and straight.

I need to be able to have some images/texts in fullscreen readable at all times.

but they also need to be able to drift in function of the world, being almost in sync (contra sync actualy) to the world

I tried to derive info from the dumpout but havn’t had any luck with that

If I get it out of the world, would it be tricky math to get it running?

best regards

pieter

#29150
Dec 11, 2006 at 10:02am

Hi Pieter,

>
> is there anyway to keep track of a rotation, you trigger by using
> jit.gl.handle on a world?

jit.gl.handle outputs a normal message rotate ….. so the rotating
information is there before it rotates your world.

have a look at the jasch objects, they are very useful for
transformation stuff

falk

#90348
Dec 11, 2006 at 10:13am

The only way I have found to do this (although I am quite open to anyone’s information to the contrary) is to use the left output from jit.gl.handle. This will give you commands such as:
“rotate 1.0 0.0 0.0 0.0″
Just use [unpack] to separate the numbers, and off you go into the wide world of mathematics. In your case, just multiply the first of the four numbers by -1, and leave the others alone.

#90349
Dec 11, 2006 at 1:19pm

On 12/11/06, pieter coussement wrote:
>
>
> is there anyway to keep track of a rotation, you trigger by using
> jit.gl.handle on a world?
>
> I want to have a videoplane running fullscreen that counterRotates in
> function of the world, so that it always remains more or less fullscreen and
> straight.

No need to keep track of rotation. Check out the new @transform_reset
attribute. Most gl objects support it. It wil keep anything from
transforming witht the rest of the context. Really easy for screen overlay
kind of things.

-thijs

#90350
Dec 11, 2006 at 4:14pm

Hello,

If I understood corectly, there’s no need to keep track of rotation, it is
as simple as adding @trasnform_reset 2 attribute to videoplane:

#P window setfont Geneva 9.;
#P window linecount 1;
#N vpatcher 472 316 795 654;
#P window setfont Geneva 9.;
#P newex 50 211 180 9961481 jit.slide @slide_up 50. @slide_down 30.;
#P newex 50 86 52 9961481 qlim 5000;
#N vpatcher 133 202 701 591;
#P window setfont Geneva 9.;
#N vpatcher 307 208 907 608;
#P inlet 104 55 15 0;
#P window setfont Geneva 9.;
#P message 41 233 195 9961481 moveto $1 $2 , write look at all these
balls;
#P message 109 260 170 9961481 moveto $1 $2 , write hello jitty kitty;
#P newex 60 119 27 9961481 + 1;
#P toggle 60 96 15 0;
#P newex 60 145 45 9961481 gate 2 1;
#P inlet 57 30 15 0;
#P outlet 72 349 15 0;
#P connect 2 0 6 0;
#P fasten 7 0 3 0 109 82 65 82;
#P connect 3 0 4 0;
#P connect 4 0 2 0;
#P connect 5 0 0 0;
#P connect 6 0 0 0;
#P connect 1 0 2 1;
#P connect 2 1 5 0;
#P pop;
#P newobj 50 216 46 9961481 p 2texts;
#N vpatcher 15 55 269 373;
#P window setfont Geneva 9.;
#P window linecount 0;
#P newex 90 67 45 9961481 t b clear;
#P window linecount 1;
#P newex 90 104 38 9961481 urn 76;
#P newex 153 193 28 9961481 * 10;
#P newex 90 193 28 9961481 * 10;
#P newex 153 167 31 9961481 / 32.;
#P newex 90 167 34 9961481 % 32.;
#P newex 90 135 31 9961481 * 10.;
#P newex 90 219 73 9961481 pack 0 0;
#P inlet 90 30 15 0;
#P outlet 90 247 15 0;
#P connect 1 0 9 0;
#P fasten 9 1 8 0 130 94 95 94;
#P connect 9 0 8 0;
#P connect 8 0 3 0;
#P connect 3 0 4 0;
#P connect 4 0 6 0;
#P connect 6 0 2 0;
#P connect 2 0 0 0;
#P fasten 3 0 5 0 95 159 158 159;
#P connect 5 0 7 0;
#P connect 7 0 2 1;
#P pop;
#P newobj 50 164 72 9961481 p rnd positions;
#P newex 50 58 252 9961481 t b b;
#P message 292 257 201 9961481 reset , brgb 0 0 0 , frgb 255 255 255 ,
clear;
#P newex 50 94 40 9961481 uzi 38;
#P inlet 50 30 15 0;
#P outlet 50 349 15 0;
#P connect 1 0 4 0;
#P connect 4 0 2 0;
#P connect 2 0 5 0;
#P connect 5 0 6 0;
#P fasten 2 1 0 0 70 130 278 130 278 302 55 302;
#P fasten 3 0 0 0 297 325 55 325;
#P connect 6 0 0 0;
#P connect 4 1 6 1;
#P connect 4 1 3 0;
#P pop;
#P newobj 50 111 53 9961481 p rnd text;
#P newex 50 167 211 9961481 jit.matrix 4 char 320 240 @planemap 1 1 1 1;
#P newex 50 139 106 9961481 jit.lcd 4 char 320 240;
#P inlet 50 30 15 0;
#P outlet 50 246 15 0;
#P connect 1 0 5 0;
#P connect 5 0 4 0;
#P connect 4 0 2 0;
#P fasten 1 0 3 0 55 67 27 67 27 161 55 161;
#P connect 2 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 0 0;
#P pop;
#P newobj 80 142 92 9961481 p image4videoplane;
#P newex 80 171 396 9961481 jit.gl.videoplane drift @layer 2 @blend_enable 1
@depth_enable 0 @transform_reset 2;
#N vpatcher 15 55 784 453;
#P window setfont Geneva 9.;
#P window linecount 1;
#P newex 68 136 37 9961481 * 0.01;
#P newex 206 147 45 9961481 loadbang;
#P newex 68 85 46 9961481 qlim 500;
#P newex 39 58 39 9961481 t b b;
#N counter;
#X flags 0 0;
#P newobj 68 109 66 9961481 counter;
#P message 68 161 68 9961481 offset 0 0 $1;
#P newex 206 264 192 9961481 jit.slide @slide_up 300. @slide_down 100.;
#P newex 206 239 174 9961481 jit.submatrix @dim 8 8 @offset 0 0 1;
#P message 206 175 134 9961481 setattr basis level -0.1 , bang;
#P newex 206 208 380 9961481 jit.bfg 3 float32 8 8 8 @basis
fractal.turbulence @weight 40. 40. 40. @align 14. 15.;
#P newex 206 292 262 9961481 jit.gl.multiple drift 1 @targetname sph
@glparams position;
#P window linecount 2;
#P newex 190 55 367 9961481 jit.gl.gridshape drift @shape sphere @dim 16 16
@smooth_shading 1 @lighting_enable 1 @name sph @scale 0.1 0.1 0.1 @automatic
0 @depth_enable 1;
#P inlet 39 38 15 0;
#P connect 0 0 9 0;
#P connect 9 1 10 0;
#P connect 10 0 8 0;
#P connect 8 0 12 0;
#P connect 12 0 7 0;
#P connect 11 0 4 0;
#P fasten 9 0 3 0 44 202 211 202;
#P connect 4 0 3 0;
#P fasten 7 0 3 0 73 198 211 198;
#P connect 3 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 2 0;
#P pop;
#P newobj 32 239 51 9961481 p gl.scene;
#P message 113 244 32 9961481 reset;
#P newex 113 268 180 9961481 jit.gl.handle drift @inherit_transform 1;
#N vpatcher 25 70 432 250;
#P window setfont Geneva 9.;
#P newex 50 50 48 9961481 t b erase;
#P inlet 50 30 15 0;
#P outlet 50 110 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 2 1 0 0 93 87 55 87;
#P pop;
#P newobj 22 265 30 9961481 p tbe;
#P newex 22 300 83 9961481 jit.gl.render drift;
#P newex 22 330 169 9961481 jit.window drift @sync 0 @floating 1;
#P toggle 22 42 15 0;
#P newex 22 65 49 9961481 qmetro 5;
#P user panel 369 165 127 30;
#X brgb 67 181 109;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 2 0 1 0;
#P fasten 6 0 4 0 118 294 27 294;
#P connect 5 0 4 0;
#P fasten 1 0 10 0 27 89 85 89;
#P fasten 1 0 8 0 27 229 37 229;
#P connect 1 0 5 0;
#P connect 10 0 9 0;
#P connect 7 0 6 0;
#P window clipboard copycount 11;

#90351

You must be logged in to reply to this topic.