Forums > Jitter

translate camera


nay
August 20, 2007 | 12:33 pm

hi all,
here goes my first post!

i have a few vids on one gl plane, using the orthographic view. i want to move the plane on the x and y axis but don’t want to use the position property of the plane as that is how i’m sticking so many vids as textures to it.

so i thought the easiest way to do it would be to move the camera but i’m not having much luck. the camera and lookat properties rotate not translate. and gltranslate seems to only work with jit.gl.sketch

i assume someone must have tackled this before even though i can’t seem to find a solution. any help HUGELY appreciated.


August 20, 2007 | 2:14 pm

Moving the camera actually does just that, but it can appear to be a type of rotation if you move the camera while keeping the lookat point constant. Stare at your mouse, and then move your head to the far left or right while continuing to look at the mouse. That’s what’s happening. You have to simultaneously change your lookat point as well if you don’t want the above effect.

I just posted an abstraction that does this and more here:

http://www.cycling74.com/forums/index.php?t=rview&th=27757&rid=3109

But here’s a simpler version doing what you want (not in orthographic view mode though):

max v2;
#N vpatcher 815 320 1285 640;
#P window setfont Geneva 9.;
#P window linecount 1;
#P hidden newex 322 79 38 196617 t 7. 4.;
#P hidden newex 322 54 48 196617 loadbang;
#P newex 322 135 27 196617 t f f;
#P newex 359 135 27 196617 t f f;
#P newex 396 135 27 196617 t f f;
#P newex 396 157 27 196617 – 1.;
#P flonum 396 107 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 359 107 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 322 107 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 285 180 121 196617 pak lookat 0. 0. 3.;
#P newex 302 202 122 196617 pak camera 0. 0. 4.;
#N vpatcher 803 44 1223 701;
#P origin 42 0;
#P window setfont Geneva 9.;
#P flonum 259 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 221 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 183 542 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 153 566 114 196617 pak rotatexyz 0. 0. 0.;
#P flonum 127 541 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 89 541 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 49 541 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 565 95 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 21 594 358 196617 jit.gl.gridshape xyTranslate @shape plane @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @poly_mode 1 1 @position 15. 0. 0. @color 1. 0. 0. 1.;
#P flonum 259 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 221 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 183 445 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 153 469 114 196617 pak rotatexyz 0. 0. 0.;
#P flonum 127 444 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 89 444 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 49 444 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 21 468 95 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 21 497 358 196617 jit.gl.gridshape xyTranslate @shape plane @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @poly_mode 1 1 @position 12. 0. 0. @color 0. 1. 0. 1.;
#P flonum 258 349 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 220 349 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 182 349 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 152 373 114 196617 pak rotatexyz 0. 0. 0.;
#P flonum 126 348 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 88 348 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 48 348 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 20 372 95 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 20 401 358 196617 jit.gl.gridshape xyTranslate @shape plane @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @poly_mode 1 1 @position 9. 0. 0. @color 0. 1. 1. 1.;
#P flonum 258 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 220 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 182 253 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 152 277 114 196617 pak rotatexyz 0. 0. 0.;
#P flonum 126 252 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 88 252 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 48 252 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 20 276 95 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 20 305 358 196617 jit.gl.gridshape xyTranslate @shape plane @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @poly_mode 1 1 @position 6. 0. 0. @color 1. 1. 0. 1.;
#P flonum 257 157 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 219 157 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 181 157 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 151 181 114 196617 pak rotatexyz 0. 0. 0.;
#P flonum 125 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 87 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 47 156 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 19 180 95 196617 pak position 0. 0. 0.;
#P window linecount 2;
#P newex 19 209 358 196617 jit.gl.gridshape xyTranslate @shape plane @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @poly_mode 1 1 @position 3. 0. 0. @color 1. 0. 1. 1.;
#P flonum 257 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 219 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 181 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 151 83 114 196617 pak rotatexyz 0. 0. 0.;
#P flonum 125 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 87 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 47 59 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 19 83 95 196617 pak position 0. 0. 0.;
#P window linecount 0;
#P newex 19 112 358 196617 jit.gl.gridshape xyTranslate @shape plane @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @poly_mode 1 1 @position 0. 0. 0. @color 1. 1. 1. 1.;
#P comment 17 25 64 196617 XYZ GUIDES;
#P connect 2 0 1 0;
#P fasten 6 0 1 0 156 105 24 105;
#P connect 11 0 10 0;
#P fasten 15 0 10 0 156 203 24 203;
#P connect 20 0 19 0;
#P fasten 24 0 19 0 157 299 25 299;
#P fasten 33 0 28 0 157 395 25 395;
#P connect 29 0 28 0;
#P fasten 42 0 37 0 158 491 26 491;
#P connect 38 0 37 0;
#P connect 47 0 46 0;
#P fasten 51 0 46 0 158 588 26 588;
#P connect 3 0 2 1;
#P connect 12 0 11 1;
#P connect 21 0 20 1;
#P connect 30 0 29 1;
#P connect 39 0 38 1;
#P connect 48 0 47 1;
#P fasten 4 0 2 2 92 78 80 78;
#P fasten 13 0 11 2 92 175 80 175;
#P fasten 22 0 20 2 93 271 81 271;
#P fasten 31 0 29 2 93 367 81 367;
#P fasten 40 0 38 2 94 463 82 463;
#P fasten 49 0 47 2 94 560 82 560;
#P fasten 5 0 2 3 130 78 108 78;
#P fasten 14 0 11 3 130 175 108 175;
#P fasten 23 0 20 3 131 271 109 271;
#P fasten 32 0 29 3 131 367 109 367;
#P fasten 41 0 38 3 132 463 110 463;
#P fasten 50 0 47 3 132 560 110 560;
#P connect 7 0 6 1;
#P connect 16 0 15 1;
#P connect 25 0 24 1;
#P connect 34 0 33 1;
#P connect 43 0 42 1;
#P connect 52 0 51 1;
#P fasten 8 0 6 2 224 80 224 80;
#P fasten 17 0 15 2 224 176 224 176;
#P fasten 26 0 24 2 225 272 225 272;
#P fasten 35 0 33 2 225 368 225 368;
#P fasten 44 0 42 2 226 464 226 464;
#P fasten 53 0 51 2 226 561 226 561;
#P fasten 9 0 6 3 262 80 258 80;
#P fasten 18 0 15 3 262 176 258 176;
#P fasten 27 0 24 3 263 272 259 272;
#P fasten 36 0 33 3 263 368 259 368;
#P fasten 45 0 42 3 264 464 260 464;
#P fasten 54 0 51 3 264 561 260 561;
#P pop;
#P newobj 19 271 80 196617 p gL_xyzGuides;
#B color 12;
#P toggle 19 74 15 0;
#P newex 19 51 38 196617 sel 27;
#P newex 19 28 40 196617 key;
#P message 19 95 70 196617 fullscreen $1;
#P hidden newex 19 138 48 196617 loadbang;
#P newex 19 206 50 196617 t b erase;
#P newex 19 184 57 196617 qmetro 40;
#P toggle 19 162 15 0;
#P newex 19 118 254 196617 jit.window xyTranslate 5 44 805 644 @depthbuffer 1;
#B color 5;
#P window linecount 2;
#P newex 19 236 280 196617 jit.gl.render xyTranslate @camera 7. 0. 4. @erase_color 0. 0. 0. 1. @light_position 50. 100. 0. 1. @antialias 1 @axes 1;
#B color 5;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P connect 9 0 6 0;
#P connect 6 0 1 0;
#P hidden connect 5 0 2 0;
#P connect 2 0 3 0;
#P connect 3 0 4 0;
#P fasten 11 0 0 0 307 228 24 228;
#P fasten 12 0 0 0 290 231 24 231;
#P connect 4 0 0 0;
#P fasten 4 1 0 0 64 227 24 227;
#P hidden connect 20 0 21 0;
#P hidden connect 21 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 12 1;
#P connect 19 1 11 1;
#P connect 14 0 18 0;
#P connect 18 0 12 2;
#P connect 18 1 11 2;
#P hidden fasten 21 1 15 0 355 101 401 101;
#P connect 15 0 17 0;
#P connect 17 0 16 0;
#P connect 16 0 12 3;
#P connect 17 1 11 3;
#P pop;



nay
August 20, 2007 | 2:26 pm

aha! thanks Zachary,
thought i was missing something simple.

look forward to taking a look at that abstraction too,
cheers.


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