[jitter] Re: Re: Control camera?
UCDMSRA
xlight63 at hotmail.com
Tue Sep 4 01:10:37 MDT 2007
- Previous message: [jitter] Bug report: jit.gl.slab not able to change context
- Next message: [jitter] Re: Re: Control camera?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Quote: Zachary Seldess wrote on Wed, 29 August 2007 07:26 ---------------------------------------------------- > Thanks Justin, this trig reviewing that I've been doing seems to be paying off. > > You need to alter the lookat coordinate AND add those values to the camera coordinates. Here's the patch with that addition. > > max v2; > #N vpatcher 439 100 1228 672; > #P origin 0 -13; > #P window setfont Geneva 9.; > #P window linecount 1; > #P newex 153 280 40 196617 t f b f; > #P newex 111 280 40 196617 t f b f; > #P newex 69 280 40 196617 t f b f; > #P comment 72 224 121 196617 adjust center of rotation; > #P comment 164 243 14 196617 z; > #P comment 82 243 14 196617 x; > #P flonum 111 259 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0; > #P flonum 153 259 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0; > #P flonum 69 259 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0; > #P comment 119 243 14 196617 y; > #P newex 291 322 27 196617 + 0.; > #P newex 251 322 27 196617 + 0.; > #P newex 211 322 27 196617 + 0.; > #P newex 27 345 138 196617 pak lookat 0. 0. 0.; > #P newex 10 531 618 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 newex 249 131 53 196617 t b b f f; > #P window linecount 3; > #P comment 390 94 317 196617 choose y-rotation behavior \; 1 is like doing flips around the ball \; 2 will keep your view oriented so your up is always "above" you \;; > #P window linecount 1; > #P hidden newex 498 164 24 196617 t 1.; > #P hidden newex 471 164 24 196617 t 0.; > #P message 406 134 14 196617 2; > #P message 390 134 14 196617 1; > #P newex 390 186 51 196617 gate 2 1; > #P newex 431 164 37 196617 abs 0.; > #P newex 431 208 331 196617 if ($f1 > 1.2 && $f1 < 1.7) || ($f1 > 4.4 && $f1 < 5.) then 0.02 else 0.; > #P window linecount 2; > #P comment 249 85 106 196617 change amplitude (distance from object); > #P flonum 249 111 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0; > #P window linecount 1; > #P newex 390 228 240 196617 if $f1 < 1.570796 || $f1 > 4.71239 then 1. else -1.; > #P window setfont Times 10.; > #P comment 396 256 48 1310730 up vector; > #P comment 447 270 39 1310730 z; > #P comment 405 270 39 1310730 y; > #P comment 362 270 39 1310730 x; > #P window setfont "Fixedwidth Serif" 9.; > #P flonum 431 286 39 9 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 390 286 39 9 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 349 286 39 9 0 0 0 22 0 0 0 221 221 221 222 222 222 0 0 0; > #P window setfont "Fixedwidth Serif" 10.; > #P newex 308 345 133 1441802 pak up 0. 1. 0.; > #P window setfont Geneva 9.; > #P flonum 169 34 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0; > #P newex 10 508 468 196617 jit.gl.gridshape sphere_rotate @shape cube @scale 1.5 0.05 0.5 @lighting_enable 1 @depth_enable 1; > #P newex 171 345 131 196617 pak camera 0. 0. 0.; > #P newex 10 486 450 196617 jit.gl.gridshape sphere_rotate @shape sphere @scale 1. 1. 1. @lighting_enable 1 @depth_enable 1; > #P toggle 203 371 15 0; > #P newex 203 416 50 196617 t b erase; > #P newex 203 394 52 196617 metro 20; > #P newex 203 443 363 196617 jit.gl.render sphere_rotate @erase_color 0. 0. 0. 1 @axes 1 @camera 4. 0. 0.; > #P newex 10 465 197 196617 jit.window sphere_rotate @depthbuffer 1; > #P comment 268 184 112 196617 rotation around y axis; > #P comment 207 35 123 196617 rotation around x/z axes; > #P comment 302 265 14 196617 z; > #P comment 224 265 14 196617 x; > #P newex 229 205 29 196617 t b f; > #P flonum 251 281 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 291 281 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 211 281 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 229 183 35 9 0 0 0 3 0 0 0 94 232 0 222 222 222 0 0 0; > #P newex 211 232 47 196617 poltocar; > #P newex 211 159 29 196617 * 4.; > #P newex 169 159 29 196617 * 4.; > #P flonum 211 117 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P flonum 169 117 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; > #P newex 169 56 67 196617 % 6.283186; > #P newex 211 94 23 196617 cos; > #P newex 169 94 21 196617 sin; > #P comment 259 265 14 196617 y; > #P connect 53 0 59 0; > #P connect 59 0 48 1; > #P connect 55 0 60 0; > #P connect 60 0 48 2; > #P connect 54 0 61 0; > #P connect 61 0 48 3; > #P connect 26 0 3 0; > #P connect 3 0 1 0; > #P connect 1 0 4 0; > #P connect 4 0 6 0; > #P fasten 46 0 6 0 254 153 174 153; > #P fasten 46 2 6 1 282 153 193 153; > #P connect 22 0 20 0; > #P fasten 20 0 21 0 208 415; > #P fasten 48 0 19 0 32 438 208 438; > #P fasten 27 0 19 0 313 438 208 438; > #P fasten 21 1 19 0 248 438 208 438; > #P connect 21 0 19 0; > #P fasten 24 0 19 0 176 438 208 438; > #P fasten 3 0 2 0 174 76 216 76; > #P connect 2 0 5 0; > #P connect 5 0 7 0; > #P fasten 46 1 7 0 268 153 216 153; > #P fasten 13 0 8 0 234 227 216 227; > #P connect 7 0 8 0; > #P connect 8 0 10 0; > #P connect 59 1 49 0; > #P lcolor 10; > #P connect 10 0 49 0; > #P connect 49 0 24 1; > #P connect 59 2 49 1; > #P lcolor 10; > #P connect 9 0 13 0; > #P fasten 46 3 7 1 296 153 235 153; > #P connect 13 1 8 1; > #P connect 36 0 46 0; > #P connect 6 0 12 0; > #P connect 60 1 50 0; > #P lcolor 10; > #P connect 12 0 50 0; > #P connect 50 0 24 2; > #P connect 60 2 50 1; > #P lcolor 10; > #P fasten 8 1 11 0 253 257 296 257; > #P connect 61 1 51 0; > #P lcolor 10; > #P connect 11 0 51 0; > #P connect 51 0 24 3; > #P connect 61 2 51 1; > #P lcolor 10; > #P connect 28 0 27 1; > #P connect 41 0 40 0; > #P fasten 42 0 40 0 411 167 395 167; > #P connect 40 0 35 0; > #P hidden connect 44 0 29 0; > #P connect 35 0 29 0; > #P connect 29 0 27 2; > #P fasten 3 0 39 0 174 76 436 76; > #P connect 39 0 40 1; > #P connect 40 1 38 0; > #P hidden connect 43 0 30 0; > #P connect 38 0 30 0; > #P connect 30 0 27 3; > #P hidden connect 41 0 43 0; > #P hidden connect 42 0 44 0; > #P pop; > ---------------------------------------------------- Hi Zachary, First of all. Your patch is soooo cool and really gave me so much fun. Thanks a lot!! Here I have one thought.............what if I want to set the camera in position 0. 0. 0. and only "look around" it? like stand in one position and looking around? I used "lookat 0. 0. 0." but I couldn't make camera really like "look around". Do you know how to do it? thank you so much CK
- Previous message: [jitter] Bug report: jit.gl.slab not able to change context
- Next message: [jitter] Re: Re: Control camera?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
