## moving from coordinate to coordinate

Feb 28, 2006 at 12:46am

# moving from coordinate to coordinate

hi,

i have a list with the actual-coorsinates and a list with new coordinates…

now i want to move an opengl object to this new coords…
how is possible with an efficient amount of objects…

is “line” the right direction?

greest
p.

#24645
Feb 28, 2006 at 11:44pm

Only if you want a straight translation, which is not always wanted.

You can combine line and scale with a table to have a incremental or
decreasing speed.
Just a hint for some better effects.

Propably there are some nicer effects to do with the movement, but
line is th easiest way in my book.

#71688
Mar 2, 2006 at 2:08am

i enjoy doing those things in matrix land.
you can store all your transformations in jit.matrix, few of them
actually(one for every keyframe), then you can interpolate between them
using jit.slide or jit.op’s and jit.expr’s.

if you’re interested in this approach, i’ll try to patch something up
quickly:)

hth,
nesa

#71689
Mar 3, 2006 at 10:44am

Well I’m interested :)

It is always nice to see other ways of doing stuff, especially when
you have no idea that it could also be done that way.

To see the confinement of the framework you are working in so to speak.

#71690
Mar 3, 2006 at 8:38pm

hi and thanks,

for now my solution was “line” and a “* 1.2″
for sure i’m interested in nesas solution too…
thx for your help to both of you.

p.

#71691
Mar 4, 2006 at 8:05pm

ok, here’s the patch(i think there was one in examples/tutorials also):

> jit.slide based moving

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 266 285 126 29425673 jump from frame to frame;
#P window setfont Arial 9.;
#P message 250 285 14 9109513 0;
#P flonum 236 261 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 236 311 116 9109513 slide_up \$1 , slide_down \$1;
#P toggle 150 85 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 150 105 68 29425673 metro 2000;
#P hidden newex 15 30 45 29425673 loadbang;
#N vpatcher 187 218 663 653;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 47 370 353 29425673 4. when dump is completed (sel done) ,
render opengl , display output;
#P comment 47 353 353 29425673 3. dump values from matrix to sketch;
#P comment 47 335 353 29425673 2. erase jit.gl.sketch contents;
#P comment 47 318 353 29425673 1. erase output window;
#P comment 49 298 353 29425673 sequence is as follows:;
#P window linecount 2;
#P message 50 158 146 29425673 moveto \$1 \$2 \$3 , shapeorient \$4 \$5 \$6
, cube 0.07;
#P window linecount 1;
#P newex 50 50 348 29425673 t l reset erase;
#P newex 110 110 43 29425673 sel done;
#P newex 50 80 71 29425673 jit.iter;
#P inlet 50 30 15 0;
#P outlet 388 220 15 0;
#P outlet 50 220 15 0;
#P window linecount 0;
#P comment 49 250 353 29425673 get numbers from matrix , and format them to
messages jit.gl.sketch understands;
#P connect 3 0 6 0;
#P connect 6 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 1 0;
#P fasten 6 1 1 0 224 214 55 214;
#P connect 4 2 5 0;
#P connect 6 2 2 0;
#P fasten 5 0 2 0 115 138 198 138 252 172 393 172;
#P pop;
#P newobj 172 368 165 29425673 p matrix-values2sketch-messages;
#P user jit.fpsgui 92 259 60 29425673 0;
#P comment 329 226 165 29425673 planes 4-6 are rotation;
#P comment 329 212 165 29425673 planes 1-3 are position;
#P number 256 132 35 9 0 0 0 449 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 65 130 665 530;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 412 244 145 29425673 adjust rotation values 0 to 360;
#P comment 409 201 158 29425673 adjust position values -0.5 to 0.5;
#P window linecount 0;
#P newex 440 103 67 29425673 prepend dim 1;
#P inlet 440 72 15 0;
#P window linecount 1;
#P newex 210 242 196 29425673 jit.op @op pass pass pass * * * @val 360;
#P newex 210 200 191 29425673 jit.op @op – - – pass pass pass @val 0.5;
#P newex 210 167 114 29425673 jit.noise 6 float32 1 10;
#P inlet 210 70 15 0;
#P outlet 210 332 15 0;
#P window linecount 0;
#P comment 233 93 100 29425673 generate random positions and rotations;
#P connect 2 0 3 0;
#P fasten 7 0 3 0 445 150 215 150;
#P connect 3 0 4 0;
#P connect 4 0 5 0;
#P connect 5 0 1 0;
#P connect 6 0 7 0;
#P pop;
#P newobj 172 172 94 29425673 p your-key-frame;
#P newex 172 211 144 29425673 jit.matrix pos-and-rot @thru 0;
#P newex 172 337 180 29425673 jit.slide @slide_up 50. @slide_down 50.;
#P button 172 136 15 0;
#P newex 172 442 249 29425673 jit.gl.sketch out @smooth_shading 1
@lighting_enable 1;
#P message 592 493 68 29425673 fullscreen \$1;
#P message 662 492 55 29425673 floating \$1;
#P toggle 662 474 15 0;
#P toggle 575 493 15 0;
#P newex 617 468 35 29425673 sel 27;
#P newex 575 468 40 29425673 key;
#P newex 314 404 82 29425673 jit.gl.render out;
#P toggle 15 57 15 0;
#P number 67 81 35 9 0 0 0 449 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 15 105 62 29425673 qmetro 20;
#P newex 592 515 75 29425673 jit.window out;
#P comment 294 133 100 29425673 number of objects;
#P comment 329 198 183 29425673 matrix containing transformation info ,;
#P fasten 16 0 21 0 177 246 97 246;
#P connect 16 0 15 0;
#P connect 5 0 3 0;
#P fasten 5 0 25 0 20 77 155 77;
#P lcolor 1;
#P hidden connect 23 0 5 0;
#P connect 3 0 16 0;
#P lcolor 1;
#P fasten 28 0 26 0 255 306 241 306;
#P connect 27 0 26 0;
#P fasten 26 0 15 0 241 331 177 331;
#P connect 10 0 11 0;
#P fasten 7 0 8 0 616 485 616 470;
#P connect 12 0 2 0;
#P fasten 11 0 2 0 667 512 597 512;
#P fasten 9 0 12 0 591 508 591 493;
#P fasten 8 0 9 0 622 490 580 490;
#P connect 4 0 3 1;
#P connect 14 0 17 0;
#P connect 18 0 17 1;
#P connect 22 1 6 0;
#P connect 15 0 22 0;
#P connect 22 0 13 0;
#P connect 17 0 16 0;
#P fasten 24 0 17 0 155 167 177 167;
#P connect 25 0 24 0;
#P window clipboard copycount 30;

#71692

You must be logged in to reply to this topic.