jit.gl.handle –> jit.p.vishnu rotation conversion

May 20, 2007 at 10:51pm

jit.gl.handle –> jit.p.vishnu rotation conversion

hi,

ive set up a particle system to fire particles in a straight line, im trying to rotate this in relation to jit.gl.handle’s rotation, ie spin a jit.gl.handle’s object and the angle the particles are firing along rotates too.

to do this ive got to convert from jit.gl.handle’s angle/axis to jit.p.vishnu’s pitch/yaw. From what ive read i think pitch and yaw are euler angles and axis angle is self explanatory!

Ive come across this super complicated explanation of how to manage these conversions

http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToEuler/index.htm

but i was hoping someone might have some javascript code to help me out! or maybe theres a simpler way of going about this,

thanks, will

#32002
May 20, 2007 at 11:17pm

Have you tried looking at jit.gl.handle’s rotatexyz attribute? The
problem with converting to euler angles is that they don’t describe
all possible 3D orientations, so there’s ambiguity.

wes

On 5/20/07, will wrote:
>
> hi,
>
> ive set up a particle system to fire particles in a straight line, im trying to rotate this in relation to jit.gl.handle’s rotation, ie spin a jit.gl.handle’s object and the angle the particles are firing along rotates too.
>
> to do this ive got to convert from jit.gl.handle’s angle/axis to jit.p.vishnu’s pitch/yaw. From what ive read i think pitch and yaw are euler angles and axis angle is self explanatory!
>
> Ive come across this super complicated explanation of how to manage these conversions
>
> http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToEuler/index.htm
>
> but i was hoping someone might have some javascript code to help me out! or maybe theres a simpler way of going about this,
>
> thanks, will
>

#104603
May 20, 2007 at 11:30pm

maybe try and simplify first, and then add in complexity.

the following patch will take an angle of rotation, which can be received from gl.handle or from wherever, and calculates the x and z components of the initial velocity (which can be sent to shiva).

you can increase the magnitude of the velocity as indicated in the patch.

this patch assumes you are only concerned with rotations around the y axis. i would not use handle to get the angle of rotation, i would use sliders and send the angle to both the object, and the particle system. you can move around the particle system by sending values to the 2nd, 3rd and 4th elements of the pak.

-rob

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 236 330 166 196617 jit.matrix brahma 8 float32 300 2;
#P newex 236 355 197 196617 jit.p.shiva @mode 1 @init 0. 0. 0. 1. 0. 0.;
#B color 8;
#P flonum 208 198 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 160 90 68 196617 unpack f f f f;
#P newex 160 67 65 196617 route rotate;
#P newex 160 46 63 196617 jit.gl.handle;
#P number 160 117 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 121 302 115 196617 pak init 0. 0. 0. 0. 0. 0.;
#P newex 160 228 27 196617 1.;
#P newex 160 202 29 196617 t b f;
#P flonum 160 184 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 160 163 40 196617 / 180.;
#P newex 160 142 65 196617 * 3.141593;
#P flonum 200 275 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 160 275 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 200 227 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 160 249 50 196617 poltocar;
#B color 5;
#P comment 197 119 133 196617 angle of rotation in degrees;
#P window linecount 2;
#P comment 238 270 100 196617 x and z components of initial velocity;
#P window linecount 3;
#P comment 263 42 100 196617 assumes you are rotating arount the y-axis only;
#P window linecount 2;
#P comment 247 196 100 196617 increase magnitude of velocity;
#P fasten 13 0 19 0 126 350 241 350;
#P connect 20 0 19 0;
#P connect 18 0 12 1;
#P connect 17 0 14 0;
#P connect 15 0 16 0;
#P connect 16 0 17 0;
#P connect 4 1 7 0;
#P connect 5 0 4 1;
#P fasten 11 1 5 0 184 223 205 223;
#P connect 4 0 6 0;
#P connect 10 0 11 0;
#P connect 9 0 10 0;
#P connect 8 0 9 0;
#P connect 12 0 4 0;
#P connect 11 0 12 0;
#P fasten 7 0 13 6 205 294 228 294;
#P fasten 6 0 13 4 165 294 194 294;
#P connect 14 0 8 0;
#P window clipboard copycount 21;

#104604
May 21, 2007 at 1:47pm

Hi Rob,

Thanks once again for your help- ive finally figured out how to plumb it into my patch and all is rotating well around the y axis, do you know of a way to get the x y and z (compnents of initial velocity) all working so the particles can fly out on all axis’s using something similar to your patch- or could you tell me what i should be looking at/reading up on!

i dont need to necessarily use jit.gl.handle as long as the angle format used can be fed to a jit.gl.model without to much fuss

cheers

#104605
May 21, 2007 at 5:58pm

i would highly recommend you check out the advanced camera example patch.
examples/jitter-examples/3rd_Party/AdvancedCamera.pat

very clearly demonstrates how to do 3d transforms using jitter matrices. it’s a little daunting, but worth studying.

other than that, as wes suggested, try using rotatexyz instead of rotate.
maybe you can just duplicate the poltocar math and for the rotation around x or z to determine the y-component of the velocity.
let me know what you come up with.
-rob

#104606
May 22, 2007 at 7:25am

will skrev:
> hi,
>
> ive set up a particle system to fire particles in a straight line, im trying to rotate this in relation to jit.gl.handle’s rotation, ie spin a jit.gl.handle’s object and the angle the particles are firing along rotates too.
>
> to do this ive got to convert from jit.gl.handle’s angle/axis to jit.p.vishnu’s pitch/yaw. From what ive read i think pitch and yaw are euler angles and axis angle is self explanatory!
>
Hi Will,
I was just looking through the Jamoma “components” and noticed an
abstraction called “jcom.aed2xyz” and another one called “jcom.xyz2aed”
- maybe these will help you?

Andreas.

#104607
May 22, 2007 at 12:33pm

Hi Andreas,
thanks for the info, ive installed these components but cant work out what the eul part of xyz2eul is and trial and error isnt helping me out today!

Ive figured out a way of rotating a central shape around 2 axes, and sending this to vishnu’s pitch and yaw to get the particle’s emmission angle to mirror the central shape, this is fine for 2 axes but as soon as i introduce a third it gets messy.

Heres my patch if anyones interested (or needs to only use 2 axes) (its hacked together from help files and a particle system from the forums, thanks to the makers!)

////////////////

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 142 43 130 196617 values between 0 and 1 !;
#P message 411 87 20 196617 30;
#P message 410 64 23 196617 0.2;
#P comment 291 217 100 196617 FIRE PARTICLES;
#P newex 352 13 48 196617 loadbang;
#P comment 285 76 61 196617 Z ROTATION;
#P comment 214 75 61 196617 Y ROTATION;
#P comment 146 76 61 196617 X ROTATION;
#P newex 215 110 65 196617 * 3.141593;
#P flonum 283 93 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 349 657 100 196617 follows blue!!!;
#P newex 978 138 87 196617 pak force 0. 0. 0.;
#P newex 977 90 91 196617 pak pos 0. 0. 0.;
#P flonum 1080 116 37 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1029 116 37 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 978 116 37 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1080 71 37 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1028 71 37 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 976 71 37 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 129 205 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 129 185 34 196617 * -1.;
#P flonum 191 208 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 191 188 34 196617 * -1.;
#P newex 215 154 29 196617 * 2.;
#P newex 142 129 29 196617 * 2.;
#P flonum 214 90 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 143 89 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 142 109 65 196617 * 3.141593;
#P toggle 537 193 15 0;
#N vpatcher 4 44 1024 768;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P hidden message 348 519 14 196617 1;
#P newex 535 8 48 196617 loadbang;
#P inlet 645 288 15 0;
#P inlet 598 286 15 0;
#P inlet 551 286 15 0;
#P newex 643 350 41 196617 * 360.;
#P flonum 644 321 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 595 351 41 196617 * 360.;
#P flonum 596 322 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 547 351 41 196617 * 360.;
#P flonum 548 322 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 575 415 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 540 415 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 505 415 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 487 572 87 196617 scale 0.3 0.3 0.3;
#P flonum 610 502 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 571 503 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 527 504 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 490 506 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 490 531 104 196617 pak rotate 0. 0. 0. 0.;
#P newex 425 457 109 196617 pak rotatexyz 0. 0. 0.;
#P comment 393 612 93 196617 (for matrixoutput);
#P toggle 329 408 15 0;
#P message 329 431 81 196617 matrixoutput $1;
#P message 206 541 90 196617 drawgroup $1;
#P number 206 520 35 9 0 20 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 5;
#P comment 423 288 105 196617 texture coordinates ; 0 – use existing ; 1 – object space ; 2 – reflection ; 3 – eye map;
#P window linecount 2;
#P comment 328 145 167 196617 standard ob3d attributes which are particularly useful for jit.gl.model:;
#P window linecount 1;
#P message 413 229 26 196617 0;
#P message 385 229 26 196617 t2;
#P message 357 229 26 196617 t1;
#P message 329 229 26 196617 grid;
#P newex 329 250 80 196617 prepend texture;
#P message 207 272 73 196617 make_normals;
#P hidden message 225 460 14 196617 1;
#P hidden message 245 144 14 196617 2;
#P hidden message 225 344 14 196617 1;
#P toggle 207 212 15 0;
#P message 207 235 88 196617 verbose $1;
#P message 236 71 99 196617 read mushrooms.obj;
#P message 330 311 62 196617 tex_map $1;
#P number 330 291 35 9 0 3 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 423 176 15 0;
#P message 423 197 90 196617 blend_enable $1;
#P toggle 207 343 15 0;
#P message 207 366 94 196617 smooth_shading $1;
#P message 205 163 90 196617 material_mode $1;
#P number 205 142 35 9 0 2 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 207 399 15 0;
#P message 207 422 81 196617 facet $1;
#P toggle 207 460 15 0;
#P message 207 482 90 196617 lighting_enable $1;
#P message 236 50 28 196617 read;
#P message 330 486 85 196617 poly_mode $1 $1;
#P toggle 330 518 15 0;
#P message 330 539 44 196617 axes $1;
#P toggle 330 464 15 0;
#P message 328 367 62 196617 cull_face $1;
#P number 328 347 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 329 179 15 0;
#P message 329 198 81 196617 depth_enable $1;
#P newex 309 587 104 196617 jit.gl.model particles;
#B color 5;
#P window linecount 2;
#P comment 234 95 218 196617 mushrooms kindly provided by Olivier Ffrench http://o.ffrench.free.fr/meshbank;
#P hidden connect 27 0 15 0;
#P connect 15 0 16 0;
#P connect 37 0 38 0;
#P connect 25 0 24 0;
#P connect 61 0 18 0;
#P hidden connect 26 0 18 0;
#P connect 18 0 17 0;
#P connect 14 0 13 0;
#P hidden connect 28 0 12 0;
#P connect 12 0 11 0;
#P connect 61 0 28 0;
#P connect 61 0 23 0;
#P connect 61 0 27 0;
#P connect 48 0 1 0;
#P connect 43 0 1 0;
#P connect 42 0 1 0;
#P fasten 38 0 1 0 211 564 314 564;
#P fasten 30 0 1 0 334 272 314 272;
#P fasten 29 0 1 0 212 293 314 293;
#P fasten 17 0 1 0 212 385 314 385;
#P fasten 24 0 1 0 212 255 314 255;
#P hidden fasten 23 0 1 0 241 47 314 47;
#P fasten 22 0 1 0 335 339 314 339;
#P fasten 13 0 1 0 212 441 314 441;
#P hidden fasten 10 0 1 0 241 70 314 70;
#P fasten 9 0 1 0 335 509 314 509;
#P fasten 7 0 1 0 335 564 314 564;
#P fasten 5 0 1 0 333 396 314 396;
#P fasten 2 0 1 0 334 218 314 218;
#P fasten 16 0 1 0 210 185 314 185;
#P fasten 11 0 1 0 212 501 314 501;
#P fasten 19 0 1 0 428 222 314 222;
#P fasten 39 0 1 0 334 454 314 454;
#P connect 4 0 5 0;
#P connect 61 0 3 0;
#P connect 3 0 2 0;
#P fasten 31 0 30 0 334 247 334 247;
#P fasten 32 0 30 0 362 247 334 247;
#P fasten 33 0 30 0 390 247 334 247;
#P fasten 34 0 30 0 418 247 334 247;
#P connect 40 0 39 0;
#P connect 21 0 22 0;
#P connect 6 0 9 0;
#P connect 62 0 8 0;
#P connect 8 0 7 0;
#P connect 61 0 62 0;
#P connect 20 0 19 0;
#P connect 49 0 42 1;
#P connect 61 0 48 0;
#P connect 50 0 42 2;
#P connect 53 0 49 0;
#P connect 44 0 43 1;
#P connect 51 0 42 3;
#P connect 45 0 43 2;
#P connect 55 0 50 0;
#P connect 52 0 53 0;
#P connect 58 0 52 0;
#P connect 46 0 43 3;
#P connect 57 0 51 0;
#P connect 47 0 43 4;
#P connect 54 0 55 0;
#P connect 59 0 54 0;
#P connect 56 0 57 0;
#P connect 60 0 56 0;
#P pop;
#P newobj 292 621 82 196617 p central_model;
#P toggle 337 164 45 0;
#P window linecount 2;
#P newex 479 661 277 196617 jit.gl.mesh particles @lighting_enable 1 @smooth_shading 1 @depth_enable 1 @blend_enable 1 @scale 0.07 0.07 0.07;
#P window linecount 1;
#P message 542 297 45 196617 emit $1;
#P message 610 297 45 196617 emit $1;
#P message 678 297 45 196617 emit $1;
#P number 678 265 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 678 203 48 196617 kd&u 99;
#N vpatcher 4 44 1024 768;
#N comlet vihnu force;
#P inlet 495 53 15 0;
#N comlet vihnu pos;
#P inlet 477 53 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 82 40 138 196617 particle dim (no. of particles);
#P comment 334 32 44 196617 shiva;
#P comment 425 31 44 196617 vishu;
#N comlet matrix bang;
#P inlet 51 56 15 0;
#N comlet dim [no of particles];
#P inlet 85 56 15 0;
#N comlet vihnu speed;
#P inlet 459 53 15 0;
#N comlet vishnu pitch;
#P inlet 441 53 15 0;
#N comlet vishnu yaw;
#P inlet 423 53 15 0;
#N comlet shiva life;
#P inlet 355 53 15 0;
#N comlet shiva emit ! SEPERATE !;
#P inlet 335 53 15 0;
#P button 172 523 15 0;
#P newex 172 499 48 196617 loadbang;
#P window linecount 3;
#P newex 172 546 317 196617 jit.gl.gridshape particles @shape torus @automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0 @matrixoutput 1;
#P number 85 83 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 85 104 48 196617 dim $1 2;
#P newex 158 251 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 172 605 277 196617 jit.gl.mesh particles @lighting_enable 1 @smooth_shading 1 @depth_enable 1 @blend_enable 1 @scale 0.07 0.07 0.07;
#P window linecount 1;
#P message 329 413 90 196617 position $1 $2 $3;
#P message 172 413 111 196617 color 0. 0. $1 1. , bang;
#P newex 172 362 167 196617 zl slice 1;
#P newex 172 335 41 196617 jit.iter;
#P newex 172 308 53 196617 jit.pack 4;
#P newex 158 273 80 196617 jit.unpack 5;
#P newex 210 217 91 196617 jit.matrix point_c;
#P newex 158 160 61 196617 jit.p.vishnu;
#P newex 158 119 56 196617 jit.p.shiva;
#P newex 158 97 160 196617 jit.matrix point_c 5 float32 50 2;
#P newex 183 385 139 196617 expr 1. – ((65. – $f1) / 65.);
#P window linecount 0;
#P comment 502 546 100 196617 replace with model loader;
#P comment 8 41 62 196617 matrix bang;
#P connect 25 0 16 0;
#P connect 16 0 15 0;
#P connect 15 0 3 0;
#P fasten 26 0 3 0 56 77 163 77;
#P connect 3 0 4 0;
#P fasten 21 0 4 0 360 91 163 91;
#P fasten 20 0 4 0 340 90 163 90;
#P fasten 24 0 5 0 464 91 163 91;
#P fasten 23 0 5 0 446 91 163 91;
#P fasten 22 0 5 0 428 91 163 91;
#P connect 4 0 5 0;
#P fasten 30 0 5 0 482 91 163 91;
#P fasten 31 0 5 0 500 91 163 91;
#P connect 5 0 14 0;
#P connect 14 0 7 0;
#P connect 7 1 8 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 2 0 11 0;
#P connect 18 0 19 0;
#P connect 19 0 17 0;
#P connect 11 0 13 0;
#P connect 12 0 13 0;
#P connect 17 0 13 0;
#P connect 10 0 2 0;
#P connect 7 2 8 1;
#P connect 7 3 8 2;
#P connect 15 0 6 0;
#P connect 5 0 6 0;
#P connect 7 4 8 3;
#P connect 10 1 12 0;
#P pop;
#P newobj 873 630 145 196617 p particle_c;
#N vpatcher 4 44 1024 768;
#N comlet vihnu force;
#P inlet 495 53 15 0;
#N comlet vihnu pos;
#P inlet 477 53 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 413 226 85 196617 pak force 0. 0. 0.;
#P newex 412 178 75 196617 pak pos 0. 0. 0.;
#P flonum 515 204 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 464 204 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 413 204 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 515 159 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 463 159 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 411 159 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 82 40 138 196617 particle dim (no. of particles);
#P comment 334 32 44 196617 shiva;
#P comment 425 31 44 196617 vishu;
#N comlet matrix bang;
#P inlet 51 56 15 0;
#N comlet dim [no of particles];
#P inlet 85 56 15 0;
#N comlet vihnu speed;
#P inlet 459 53 15 0;
#N comlet vishnu pitch;
#P inlet 441 53 15 0;
#N comlet vishnu yaw;
#P inlet 423 53 15 0;
#N comlet shiva life;
#P inlet 355 53 15 0;
#N comlet shiva emit ! SEPERATE !;
#P inlet 335 53 15 0;
#P button 172 523 15 0;
#P newex 172 499 48 196617 loadbang;
#P window linecount 3;
#P newex 172 546 313 196617 jit.gl.gridshape particles @shape cube @automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0 @matrixoutput 1;
#P number 85 83 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 85 104 48 196617 dim $1 2;
#P newex 158 251 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 172 605 277 196617 jit.gl.mesh particles @lighting_enable 1 @smooth_shading 1 @depth_enable 1 @blend_enable 1 @scale 0.07 0.07 0.07;
#P window linecount 1;
#P message 329 413 90 196617 position $1 $2 $3;
#P message 172 413 111 196617 color 0. 0. $1 1. , bang;
#P newex 172 362 167 196617 zl slice 1;
#P newex 172 335 41 196617 jit.iter;
#P newex 172 308 53 196617 jit.pack 4;
#P newex 158 273 80 196617 jit.unpack 5;
#P newex 210 217 91 196617 jit.matrix point_b;
#P newex 158 160 61 196617 jit.p.vishnu;
#P newex 158 119 56 196617 jit.p.shiva;
#P newex 158 97 160 196617 jit.matrix point_b 5 float32 50 2;
#P newex 183 385 139 196617 expr 1. – ((65. – $f1) / 65.);
#P window linecount 0;
#P comment 502 546 100 196617 replace with model loader;
#P comment 8 41 62 196617 matrix bang;
#P connect 25 0 16 0;
#P connect 16 0 15 0;
#P connect 15 0 3 0;
#P fasten 26 0 3 0 56 77 163 77;
#P connect 3 0 4 0;
#P fasten 20 0 4 0 340 90 163 90;
#P fasten 21 0 4 0 360 91 163 91;
#P connect 4 0 5 0;
#P fasten 22 0 5 0 428 91 163 91;
#P fasten 23 0 5 0 446 91 163 91;
#P fasten 24 0 5 0 464 91 163 91;
#P connect 36 0 5 0;
#P connect 37 0 5 0;
#P fasten 39 0 5 0 500 91 163 91;
#P fasten 38 0 5 0 482 91 163 91;
#P connect 5 0 14 0;
#P connect 14 0 7 0;
#P connect 7 1 8 0;
#P connect 8 0 9 0;
#P connect 9 0 10 0;
#P connect 2 0 11 0;
#P connect 18 0 19 0;
#P connect 19 0 17 0;
#P connect 12 0 13 0;
#P connect 11 0 13 0;
#P connect 17 0 13 0;
#P connect 10 0 2 0;
#P connect 7 2 8 1;
#P connect 7 3 8 2;
#P connect 15 0 6 0;
#P connect 5 0 6 0;
#P connect 7 4 8 3;
#P connect 10 1 12 0;
#P fasten 30 0 36 1 416 176 438 176;
#P fasten 33 0 37 1 418 221 443 221;
#P fasten 31 0 36 2 468 176 459 176;
#P fasten 34 0 37 2 469 221 468 221;
#P fasten 32 0 36 3 520 176 480 176;
#P fasten 35 0 37 3 520 221 493 221;
#P pop;
#P newobj 679 630 191 196617 p particle_b;
#P window linecount 7;
#P comment 434 71 72 196617 dim = number of particles life = length they live so they are both connected life = dim;
#P window linecount 1;
#N vpatcher 4 44 1024 768;
#N comlet vihnu force;
#P inlet 503 53 15 0;
#N comlet vihnu pos;
#P inlet 485 53 15 0;
#P outlet 170 642 15 0;
#P outlet 147 642 15 0;
#P outlet 130 642 15 0;
#P button 53 88 15 0;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 80 39 138 196617 particle dim (no. of particles);
#P comment 6 40 62 196617 matrix bang;
#P comment 334 32 44 196617 shiva;
#P comment 425 31 44 196617 vishu;
#N comlet matrix bang;
#P inlet 51 56 15 0;
#N comlet dim [no of particles];
#P inlet 85 56 15 0;
#N comlet vihnu speed;
#P inlet 459 53 15 0;
#N comlet vishnu pitch;
#P inlet 441 53 15 0;
#N comlet vishnu yaw;
#P inlet 423 53 15 0;
#N comlet shiva life;
#P inlet 355 53 15 0;
#N comlet shiva emit ! SEPERATE !;
#P inlet 335 53 15 0;
#P button 172 523 15 0;
#P newex 172 499 48 196617 loadbang;
#P window linecount 3;
#P newex 172 546 322 196617 jit.gl.gridshape particles @shape sphere @automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0 @matrixoutput 1;
#P number 85 83 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 85 104 48 196617 dim $1 2;
#P newex 158 251 100 196617 jit.split @splitdim 1;
#P message 329 413 90 196617 position $1 $2 $3;
#P message 172 413 111 196617 color 0. 0. $1 1. , bang;
#P newex 172 362 167 196617 zl slice 1;
#P newex 172 335 41 196617 jit.iter;
#P newex 172 308 53 196617 jit.pack 4;
#P newex 158 273 80 196617 jit.unpack 5;
#P newex 210 217 160 196617 jit.matrix point_a 5 float32 50 2;
#P newex 160 163 61 196617 jit.p.vishnu;
#P newex 174 134 56 196617 jit.p.shiva;
#P newex 161 95 160 196617 jit.matrix point_a 5 float32 50 2;
#P newex 183 385 139 196617 expr 1. – ((65. – $f1) / 65.);
#P window linecount 2;
#P comment 502 546 100 196617 replace with model loader;
#P connect 24 0 29 0;
#P connect 23 0 14 0;
#P connect 14 0 13 0;
#P connect 10 0 30 0;
#P connect 15 0 31 0;
#P connect 4 0 12 0;
#P connect 12 0 6 0;
#P connect 3 0 4 0;
#P fasten 20 0 4 0 428 91 165 91;
#P fasten 21 0 4 0 446 91 165 91;
#P fasten 22 0 4 0 464 114 165 114;
#P fasten 33 0 4 0 490 114 165 114;
#P fasten 34 0 4 0 508 114 165 114;
#P connect 13 0 2 0;
#P connect 24 0 2 0;
#P connect 11 0 32 0;
#P connect 6 1 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 1 0 10 0;
#P connect 16 0 17 0;
#P connect 17 0 15 0;
#P fasten 18 0 3 0 340 89 179 89;
#P fasten 19 0 3 0 360 91 179 91;
#P connect 2 0 3 0;
#P connect 9 0 1 0;
#P connect 6 2 7 1;
#P connect 6 3 7 2;
#P connect 4 0 5 0;
#P connect 13 0 5 0;
#P connect 6 4 7 3;
#P connect 9 1 11 0;
#P pop;
#P newobj 479 630 197 196617 p particle_a;
#P number 622 264 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 622 203 54 196617 kd&u 120;
#P number 565 265 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 565 203 54 196617 kd&u 122;
#P window linecount 2;
#P comment 873 170 100 196617 more speed = less gravity BLINGTOT;
#P window linecount 1;
#P message 19 191 55 196617 floating $1;
#P toggle 19 173 15 0;
#P comment 733 80 100 196617 VISHNU;
#P message 895 79 14 196617 0;
#P newex 907 22 48 196617 loadbang;
#P newex 645 29 48 196617 loadbang;
#P message 625 97 14 196617 0;
#P message 629 122 62 196617 life_var $1;
#P message 629 142 67 196617 emit_var $1;
#P message 895 146 70 196617 speed_var $1;
#P flonum 843 105 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 843 124 48 196617 speed $1;
#P message 895 126 64 196617 yaw_var $1;
#P message 895 106 65 196617 pitch_var $1;
#P number 578 97 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 530 97 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 530 117 40 196617 life $1;
#P message 578 117 45 196617 emit $1;
#P flonum 747 105 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 747 124 42 196617 yaw $1;
#P flonum 795 105 47 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 795 124 45 196617 pitch $1;
#P user jit.fpsgui 20 236 60 196617 0;
#P newex 3 724 214 196617 jit.window particles @depthbuffer 1 @sync 0;
#P newex 2 698 300 196617 jit.gl.render particles @erase_color 0. 0. 0. 1. @automatic 0;
#P newex 2 131 74 196617 t b b b b erase;
#P newex 2 104 51 196617 qmetro 2;
#P toggle 1 62 40 0;
#P comment 529 79 100 196617 SHIVA;
#P user panel 720 69 253 99;
#X brgb 255 220 180;
#X frgb 100 100 100;
#X border 3;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 669 230 100 196617 plug into emits;
#P user panel 521 70 176 97;
#X brgb 255 220 180;
#X frgb 100 100 100;
#X border 3;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 132 74 271 165;
#X brgb 255 220 180;
#X frgb 100 100 100;
#X border 3;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 7 0 8 0;
#P connect 7 0 10 0;
#P connect 29 0 19 0;
#P connect 29 0 20 0;
#P connect 29 0 23 0;
#P connect 29 0 60 0;
#P connect 29 0 63 0;
#P connect 29 0 61 0;
#P connect 29 0 64 0;
#P connect 29 0 62 0;
#P connect 29 0 65 0;
#P fasten 62 0 66 3 1085 88 1063 88;
#P fasten 65 0 67 3 1085 133 1058 133;
#P fasten 61 0 66 2 1033 88 1036 88;
#P fasten 64 0 67 2 1034 133 1033 133;
#P fasten 60 0 66 1 981 88 1009 88;
#P fasten 63 0 67 1 983 133 1008 133;
#P fasten 67 0 38 8 983 392 668 392;
#P fasten 67 0 40 8 983 392 860 392;
#P fasten 67 0 41 8 983 392 1006 392;
#P fasten 66 0 38 7 982 368 645 368;
#P fasten 66 0 40 7 982 368 838 368;
#P fasten 66 0 41 7 982 368 990 368;
#P fasten 23 0 38 6 900 395 622 395;
#P fasten 23 0 40 6 900 395 816 395;
#P fasten 23 0 41 6 900 395 974 395;
#P fasten 21 0 38 6 848 384 622 384;
#P fasten 21 0 40 6 848 384 816 384;
#P fasten 21 0 41 6 848 384 974 384;
#P fasten 19 0 38 5 900 375 599 375;
#P fasten 19 0 40 5 900 375 794 375;
#P fasten 19 0 41 5 900 375 958 375;
#P fasten 11 0 38 5 800 387 599 387;
#P fasten 11 0 40 5 800 387 794 387;
#P fasten 11 0 41 5 800 387 958 387;
#P fasten 20 0 38 4 900 385 576 385;
#P fasten 20 0 40 4 900 385 772 385;
#P fasten 20 0 41 4 900 385 942 385;
#P fasten 13 0 38 4 752 387 576 387;
#P fasten 13 0 40 4 752 387 772 387;
#P fasten 13 0 41 4 752 387 942 387;
#P fasten 25 0 38 3 634 383 553 383;
#P fasten 25 0 40 3 634 383 750 383;
#P fasten 25 0 41 3 634 383 926 383;
#P fasten 16 0 38 3 535 383 553 383;
#P fasten 16 0 40 3 535 383 750 383;
#P fasten 16 0 41 3 535 383 926 383;
#P fasten 24 0 38 2 634 393 530 393;
#P fasten 24 0 40 2 634 351 728 351;
#P fasten 24 0 41 2 634 352 910 352;
#P fasten 44 0 41 2 683 491 910 491;
#P connect 28 0 29 0;
#P fasten 17 0 38 1 535 373 507 373;
#P connect 17 0 16 0;
#P fasten 17 0 40 1 535 373 706 373;
#P fasten 17 0 41 1 535 374 894 374;
#P connect 7 3 41 0;
#P connect 22 0 21 0;
#P connect 76 0 22 0;
#P connect 12 0 11 0;
#P connect 55 0 12 0;
#P connect 14 0 13 0;
#P connect 54 0 14 0;
#P fasten 45 0 40 2 615 491 728 491;
#P connect 7 2 40 0;
#P connect 43 0 44 0;
#P connect 42 0 43 0;
#P connect 26 0 24 0;
#P connect 26 0 25 0;
#P connect 27 0 26 0;
#P connect 36 0 37 0;
#P connect 50 0 37 0;
#P connect 37 0 45 0;
#P connect 18 0 15 0;
#P connect 48 0 35 0;
#P connect 34 0 35 0;
#P connect 35 0 46 0;
#P connect 77 0 17 0;
#P fasten 46 0 38 2 547 491 530 491;
#P connect 38 2 47 0;
#P connect 38 1 47 0;
#P connect 38 0 47 0;
#P connect 7 1 38 0;
#P connect 74 0 48 0;
#P connect 74 0 76 0;
#P connect 74 0 77 0;
#P connect 69 0 49 2;
#P connect 59 0 49 1;
#P connect 57 0 49 0;
#P connect 70 0 55 0;
#P connect 53 0 56 0;
#P connect 53 0 70 0;
#P connect 56 0 57 0;
#P connect 51 0 54 0;
#P connect 52 0 58 0;
#P connect 52 0 51 0;
#P connect 58 0 59 0;
#P connect 31 0 32 0;
#P connect 32 0 9 0;
#P fasten 7 4 8 0 71 193 7 193;
#P connect 6 0 7 0;
#P connect 5 0 6 0;
#P window clipboard copycount 79;

I think all thats needed is for my Z axis to alter pitch and yaw in relation to the X and Y axis but trail and error maths isnt proving too fruitful atm.

#104608

You must be logged in to reply to this topic.