XML Feeds

.

[jitter] Re: Control camera?

Zachary Seldess zseldess at hotmail.com
Tue Sep 4 19:51:52 MDT 2007


Here's a quick example patch that uses a dial for infinite lookat rotation along the x/z plane and a multislider for rotation along the y axis. Hope it helps clarify.


max v2;
#N vpatcher 473 283 986 786;
#P origin 0 -13;
#P window setfont Geneva 9.;
#P window linecount 1;
#P hidden newex 298 158 41 196617 t 90 4.;
#P hidden newex 298 135 48 196617 loadbang;
#P comment 218 26 46 196617 y lookat;
#P user multiSlider 229 42 21 108 -1. 1. 1 2681 47 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 329 238 40 196617 t b f f;
#P newex 287 238 40 196617 t b f f;
#P newex 245 238 40 196617 t b f f;
#P comment 248 182 121 196617 adjust camera position;
#P comment 340 201 14 196617 z;
#P comment 258 201 14 196617 x;
#P flonum 287 217 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0;
#P flonum 329 217 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0;
#P flonum 245 217 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0;
#P comment 295 201 14 196617 y;
#P newex 233 303 137 196617 pak camera 0. 0. 0.;
#P newex 191 278 27 196617 + 0.;
#P newex 149 278 27 196617 + 0.;
#P newex 107 278 27 196617 + 0.;
#N vpatcher 118 244 465 511;
#P outlet 68 210 15 0;
#P outlet 31 210 15 0;
#P inlet 31 35 15 0;
#P window setfont Geneva 9.;
#P comment 82 163 164 196617 generate x/z values;
#P comment 159 109 164 196617 convert from degrees into radians;
#P window setfont "Sans Serif" 9.;
#P newex 31 133 47 131137545 t 1. f;
#P window setfont Geneva 9.;
#P flonum 31 186 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 68 186 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 31 107 125 131137545 expr ($f1 * 3.141593) / 180.;
#P window setfont Geneva 9.;
#P newex 31 160 47 196617 poltocar;
#P newex 31 82 40 196617 % 360;
#P newex 31 57 37 196617 + 181;
#P comment 73 84 100 196617 straigth up is now 0;
#P connect 10 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 11 0;
#P connect 7 1 3 1;
#P connect 3 1 5 0;
#P connect 5 0 12 0;
#P pop;
#P hidden newobj 107 156 94 196617 p lookat_x/z;
#B color 12;
#P user dial 107 42 108 108 360 1 0 0 157 359 1 1. 101 85 147 221 221 221 120 120 120 225 225 225 0 0 0 0 0 0;
#P newex 191 237 27 196617 t f f;
#P newex 149 237 27 196617 t f f;
#P newex 107 237 27 196617 t f f;
#P comment 110 181 121 196617 adjust center of rotation;
#P comment 202 200 14 196617 z;
#P comment 120 200 14 196617 x;
#P flonum 149 216 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0;
#P flonum 191 216 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0;
#P flonum 107 216 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0;
#P comment 157 200 14 196617 y;
#P newex 65 302 138 196617 pak lookat 0. 0. 0.;
#P window linecount 2;
#P newex 9 439 468 196617 jit.gl.gridshape sphere_rotate @shape cube @scale 10. 10. 10. @poly_mode 1 1 @lighting_enable 1 @depth_enable 1 @color 1. 1. 0. 1.;
#P window linecount 1;
#P newex 9 416 468 196617 jit.gl.gridshape sphere_rotate @shape cube @scale 1.5 0.05 0.5 @lighting_enable 1 @depth_enable 1;
#P newex 9 394 450 196617 jit.gl.gridshape sphere_rotate @shape sphere @scale 1. 1. 1. @lighting_enable 1 @depth_enable 1;
#P toggle 9 279 15 0;
#P newex 9 324 50 196617 t b erase;
#P newex 9 302 52 196617 metro 20;
#P newex 9 351 363 196617 jit.gl.render sphere_rotate @erase_color 0. 0. 0. 1 @axes 1 @camera 0. 0. 4.;
#P newex 9 373 197 196617 jit.window sphere_rotate @depthbuffer 1;
#P comment 131 25 57 196617 x/z lookat;
#P connect 5 0 3 0;
#P fasten 3 0 4 0 14 323;
#P fasten 25 0 2 0 238 346 14 346;
#P connect 4 0 2 0;
#P fasten 4 1 2 0 54 346 14 346;
#P fasten 9 0 2 0 70 346 14 346;
#P hidden connect 39 0 20 0;
#P hidden connect 20 0 21 0;
#P hidden connect 21 0 11 0;
#P connect 11 0 17 0;
#P connect 17 0 22 0;
#P connect 33 0 22 0;
#P lcolor 10;
#P connect 22 0 9 1;
#P connect 33 1 22 1;
#P lcolor 10;
#P hidden connect 36 0 13 0;
#P connect 13 0 18 0;
#P connect 18 0 23 0;
#P connect 34 0 23 0;
#P lcolor 10;
#P connect 23 0 9 2;
#P connect 34 1 23 1;
#P lcolor 10;
#P hidden connect 21 1 12 0;
#P connect 12 0 19 0;
#P connect 19 0 24 0;
#P connect 35 0 24 0;
#P lcolor 10;
#P connect 24 0 9 3;
#P connect 35 1 24 1;
#P lcolor 10;
#P connect 27 0 33 0;
#P connect 33 2 25 1;
#P connect 29 0 34 0;
#P hidden connect 38 0 39 0;
#P connect 34 2 25 2;
#P hidden connect 39 1 28 0;
#P connect 28 0 35 0;
#P connect 35 2 25 3;
#P pop;

--
http://www.zacharyseldess.com



More information about the jitter mailing list