Hi list,
I currently have a little math problem:
I have a wavefront model (see below) which looks a bit like a stick. I want to set the position by 2 points in 3D (beginning and end) instead of one point, rotation , and scale. Any help would be great!!
Thanks
Falk
I put a testpatch and the model below:
#N canvas 59 34 867 633 10; #X obj 109 300 model; #X obj 4 260 openpanel; #X obj 1 233 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 21 285 open $1; #X obj 57 87 gemhead; #X obj 56 146 rotateXYZ; #X floatatom 70 119 5 0 0 0 - - -; #X floatatom 110 127 5 0 0 0 - - -; #X floatatom 154 127 5 0 0 0 - - -; #X obj 62 194 translateXYZ; #X floatatom 87 172 5 0 0 0 - - -; #X floatatom 128 171 5 0 0 0 - - -; #X floatatom 168 173 5 0 0 0 - - -; #X obj 425 319 sphere 0.05; #X obj 423 253 gemhead; #X obj 425 296 translateXYZ; #X floatatom 450 274 5 0 0 0 - - -; #X floatatom 491 273 5 0 0 0 - - -; #X floatatom 530 274 5 0 0 0 - - -; #X floatatom 109 232 5 0 0 0 - - -; #X floatatom 154 232 5 0 0 0 - - -; #X obj 91 261 scaleXYZ 10 10 10; #X floatatom 207 238 5 0 0 0 - - -; #X obj 414 410 sphere 0.05; #X obj 412 344 gemhead; #X obj 414 387 translateXYZ; #X floatatom 439 365 5 0 0 0 - - -; #X floatatom 480 364 5 0 0 0 - - -; #X floatatom 519 365 5 0 0 0 - - -; #X msg 234 63 create , reset , lighting 1 , 1; #X obj 297 146 gemwin; #X msg 448 61 destroy; #X obj 525 37 gemhead; #X obj 525 75 world_light; #X obj 381 36 sel 1; #X obj 234 31 loadbang; #X obj 379 6 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1 ; #X connect 1 0 3 0; #X connect 2 0 1 0; #X connect 3 0 0 0; #X connect 4 0 5 0; #X connect 5 0 9 0; #X connect 6 0 5 1; #X connect 7 0 5 2; #X connect 8 0 5 3; #X connect 9 0 21 0; #X connect 10 0 9 1; #X connect 11 0 9 2; #X connect 12 0 9 3; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 16 0 15 1; #X connect 17 0 15 2; #X connect 18 0 15 3; #X connect 19 0 21 1; #X connect 20 0 21 2; #X connect 21 0 0 0; #X connect 22 0 21 3; #X connect 24 0 25 0; #X connect 25 0 23 0; #X connect 26 0 25 1; #X connect 27 0 25 2; #X connect 28 0 25 3; #X connect 29 0 30 0; #X connect 31 0 30 0; #X connect 32 0 33 0; #X connect 34 0 29 0; #X connect 34 1 31 0; #X connect 35 0 29 0; #X connect 36 0 34 0;
The model:
# Max2Obj Version 4.0 Mar 10th, 2001 # # object Object05 to come ... # v -63.5 7.4 1.4 v -63.5 7.4 1.4 v -63.5 7.4 1.4 v -65.9 11.7 1.8 v -66.1 11.5 1.8 v -66.2 12.6 2.0 v -58.0 0.4 0.2 v -58.0 0.4 0.2 v -58.0 0.4 0.2 v -67.0 15.5 2.8 v -66.8 15.5 2.8 v -67.2 16.2 2.8 v -66.0 12.5 2.1 v -66.2 13.4 2.3 v -66.8 14.9 2.6 v -66.8 14.9 2.6 v -66.8 14.9 2.6 v -63.5 7.4 1.4 v -63.5 7.4 1.4 v -63.5 7.4 1.4 v -60.0 2.8 1.3 v -59.7 3.0 1.3 v -60.9 4.0 1.5 v -53.7 -5.0 -2.7 v -53.8 -5.3 -2.5 v -54.7 -3.7 -1.6 v -67.2 17.3 2.9 v -67.2 17.2 3.0 v -67.2 17.7 2.9 v -56.3 -0.6 0.1 v -56.5 -0.7 -0.2 v -57.7 0.7 0.3 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -67.0 16.9 2.8 v -67.1 16.9 2.8 v -67.0 17.3 2.9 v -61.7 5.3 1.4 v -61.6 5.5 1.3 v -62.6 6.4 1.5 v -64.0 8.6 1.5 v -63.4 7.5 1.3 v -64.1 8.6 1.4 v -58.0 0.4 0.2 v -58.0 0.4 0.2 v -53.0 -4.8 -2.2 v -53.3 -4.7 -2.6 v -54.1 -3.4 -1.2 v -66.8 14.9 2.6 v -66.8 14.9 2.6 v -66.8 14.9 2.6 v -67.2 17.4 2.9 v -67.3 16.7 2.8 v -67.3 17.2 3.0 v -67.0 16.3 2.7 v -67.1 16.4 2.7 v -65.1 9.3 1.7 v -64.1 8.5 1.7 v -64.8 9.5 1.8 v -57.8 0.5 0.5 v -62.9 6.1 1.4 v -63.6 7.2 1.6 v -63.3 7.6 1.4 v -57.7 0.7 0.3 v -57.8 0.6 -0.0 v -58.7 1.9 0.6 v -67.4 18.9 2.9 v -67.4 18.9 3.0 v -67.5 19.2 2.9 v -60.6 4.2 1.5 v -59.6 3.2 1.1 v -60.5 4.4 1.3 v -55.2 -2.0 -0.4 v -55.4 -2.0 -0.7 v -67.4 18.5 3.0 v -67.3 18.5 3.0 v -67.4 18.8 3.0 v -67.2 18.6 2.9 v -67.3 18.6 2.9 v -67.3 18.9 3.0 v -62.6 6.4 1.1 v -62.9 6.2 1.0 v -63.4 7.5 1.2 v -59.7 3.2 0.9 v -67.4 18.9 3.0 v -67.4 18.9 3.0 v -67.4 18.9 3.0 v -65.1 9.4 1.4 v -65.2 9.3 1.6 v -65.7 10.4 1.6 v -67.0 17.3 2.9 v -67.1 17.4 2.9 v -67.0 17.8 3.0 v -56.8 -1.2 0.3 v -55.3 -2.2 -0.1 v -56.5 -0.9 0.4 v -60.0 2.9 0.8 v -60.7 4.3 1.1 v -66.9 14.0 2.5 v -66.5 13.1 2.4 v -66.7 13.9 2.6 v -64.8 9.5 1.7 v -64.7 9.6 1.6 v -65.3 10.5 1.9 v -63.4 7.4 1.6 v -62.5 6.5 1.3 v -63.2 7.6 1.4 v -66.3 13.2 2.4 v -66.5 14.0 2.6 v -60.1 2.7 1.0 v -60.9 4.1 1.0 v -67.5 19.5 2.9 v -67.5 19.5 2.9 v -67.5 19.5 2.9 v -67.5 19.5 2.9 v -67.5 19.5 2.9 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -62.0 5.1 1.0 v -67.3 18.1 3.0 v -67.2 18.2 3.0 v -59.2 1.6 0.3 v -58.3 0.1 0.1 v -59.3 1.4 0.5 v -59.8 3.0 1.1 v -59.8 3.0 1.1 v -59.8 3.0 1.1 v -67.6 19.8 2.9 v -67.5 19.5 3.0 v -67.5 19.8 3.0 v -59.1 1.4 0.8 v -60.2 2.7 1.0 v -63.0 6.0 1.2 v -63.8 7.1 1.4 v -58.3 0.0 0.1 v -58.1 0.1 0.4 v -67.5 19.2 3.0 v -67.4 19.2 3.0 v -67.6 19.5 3.0 v -66.6 15.0 2.6 v -66.6 14.2 2.4 v -66.7 15.0 2.5 v -67.6 20.0 3.0 v -67.5 20.0 3.0 v -66.5 13.3 2.3 v -66.5 13.3 2.3 v -66.5 13.3 2.3 v -55.1 -2.0 -0.4 v -54.3 -3.4 -1.5 v -55.4 -2.0 -0.7 v -67.3 19.2 3.0 v -67.3 18.9 3.0 v -67.3 19.3 3.0 v -67.4 18.9 3.0 v -67.4 18.9 3.0 v -65.7 11.6 1.9 v -62.0 5.1 1.4 v -66.4 12.4 2.0 v -66.5 12.3 2.1 v -66.6 13.3 2.2 v -53.1 -5.1 -2.0 v -54.2 -3.8 -1.0 v -57.8 0.6 -0.0 v -56.9 -1.0 -0.3 v -58.1 0.2 -0.2 v -65.0 9.5 1.6 v -65.0 9.5 1.6 v -65.0 9.5 1.6 v -67.4 18.1 3.0 v -67.5 18.5 3.0 v -58.1 0.3 -0.1 v -54.8 -4.0 -1.4 v -53.5 -5.4 -2.1 v -54.6 -4.0 -1.1 v -66.8 14.7 2.7 v -65.0 9.3 1.7 v -65.8 10.3 1.7 v -67.1 16.3 2.8 v -67.1 16.3 2.8 v -67.1 16.3 2.8 v -67.4 19.6 2.9 v -67.5 19.6 2.9 v -67.4 19.8 2.9 v -67.3 18.2 2.9 v -67.4 18.2 2.9 v -66.4 13.5 2.2 v -66.2 11.4 1.9 v -59.5 3.2 1.1 v -58.9 1.9 0.3 v -59.7 3.2 0.9 v -66.4 14.2 2.5 v -67.5 19.5 2.9 v -66.6 14.8 2.7 v -67.3 18.9 3.0 v -67.2 18.2 2.9 v -67.4 18.9 3.0 v -67.1 17.3 2.9 v -67.1 17.3 2.9 v -67.1 17.3 2.9 v -61.7 5.4 1.4 v -64.9 9.6 1.5 v -65.4 10.6 1.6 v -67.6 19.5 3.0 v -57.0 -1.2 -0.1 v -67.5 20.1 2.9 v -67.5 20.1 2.9 v -67.5 20.1 2.9 v -58.8 1.7 0.8 v -60.0 2.7 1.3 v -67.5 19.6 2.9 v -67.6 19.8 2.9 v -67.4 19.6 2.9 v -67.3 18.2 3.0 v -67.3 18.2 3.0 v -67.3 18.2 3.0 v -67.4 18.2 2.9 v -67.3 17.7 3.0 v -67.4 18.1 3.0 v -63.5 7.4 1.4 v -63.5 7.4 1.4 v -67.5 20.1 2.9 v -67.5 20.1 2.9 v -67.5 20.1 2.9 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -66.7 15.7 2.7 v -67.0 16.2 2.8 v -57.8 0.4 0.5 v -67.4 18.9 3.0 v -67.2 16.3 2.7 v -67.3 16.2 2.8 v -67.3 16.8 2.8 v -66.5 13.1 2.4 v -66.1 12.4 2.2 v -66.3 13.2 2.4 v -66.3 12.2 2.2 v -67.5 19.5 2.9 v -58.0 0.4 0.2 v -58.0 0.4 0.2 v -61.7 5.4 1.0 v -67.2 18.2 2.9 v -67.1 17.8 2.9 v -67.2 18.2 2.9 v -67.1 17.2 3.0 v -67.2 17.6 3.0 v -67.5 19.5 2.9 v -63.7 7.3 1.2 v -65.3 10.6 1.7 v -65.7 11.7 1.9 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -64.9 9.5 1.6 v -64.9 9.5 1.6 v -64.9 9.5 1.6 v -58.0 0.4 0.2 v -58.0 0.4 0.2 v -55.7 -2.6 -0.2 v -64.4 8.3 1.3 v -64.5 8.2 1.5 v -65.1 9.4 1.4 v -67.1 16.3 2.8 v -59.8 3.0 1.1 v -59.8 3.0 1.1 v -55.9 -2.6 -0.6 v -55.6 -2.6 -0.2 v -61.1 3.9 1.2 v -61.9 5.1 1.0 v -67.4 18.9 3.0 v -67.4 18.9 3.0 v -55.3 -2.3 -0.1 v -59.8 3.0 1.1 v -59.8 3.0 1.1 v -66.7 15.0 2.5 v -66.9 14.9 2.6 v -66.9 15.7 2.6 v -67.1 17.3 2.9 v -67.1 17.3 2.9 v -67.1 17.3 2.9 v -67.4 19.8 3.0 v -60.1 3.0 0.8 v -66.9 14.9 2.5 v -67.0 14.8 2.7 v -67.1 17.4 2.9 v -67.3 18.1 3.0 v -67.1 17.7 3.0 v -67.2 18.2 3.0 v -67.5 19.5 3.0 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -67.5 20.1 2.9 v -67.6 20.1 2.9 v -67.2 16.7 2.9 v -67.0 16.2 2.8 v -67.1 16.8 2.9 v -59.6 3.0 1.3 v -62.1 4.9 1.2 v -66.5 13.3 2.3 v -66.5 13.3 2.3 v -67.4 19.5 3.0 v -65.6 10.3 1.9 v -67.4 18.6 2.9 v -67.4 18.9 2.9 v -67.1 17.3 2.9 v -67.1 17.3 2.9 v -55.7 -2.3 -0.8 v -66.0 11.3 2.1 v -58.1 0.1 0.4 v -55.8 -2.3 -0.8 v -66.9 16.4 2.7 v -67.1 16.4 2.7 v -62.0 5.1 1.4 v -64.8 9.6 1.4 v -66.5 13.3 2.3 v -65.9 11.5 1.9 v -65.9 11.5 1.9 v -65.9 11.5 1.9 v -61.8 5.2 1.2 v -66.7 13.2 2.3 v -64.3 8.3 1.7 v -65.2 9.2 1.6 v -67.4 19.5 3.0 v -67.4 19.6 2.9 v -67.1 15.5 2.7 v -67.3 16.2 2.8 v -67.4 18.9 3.0 v -67.1 15.6 2.6 v -67.5 18.9 3.0 v -65.9 11.5 1.9 v -65.9 11.5 1.9 v -65.9 11.5 1.9 v -67.4 19.3 2.9 v -66.8 14.9 2.6 v -67.3 16.3 2.7 v -67.5 19.8 2.9 v -67.4 20.1 2.9 v -66.8 14.9 2.6 v -66.2 13.4 2.3 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -55.5 -2.3 -0.5 v -61.8 5.2 1.2 v -67.2 16.2 2.8 v -66.8 14.1 2.4 v -65.0 9.5 1.6 v -67.3 19.0 2.9 v -66.7 13.2 2.3 v -66.6 15.0 2.6 v -67.1 16.3 2.8 v -67.0 17.2 3.0 v -66.4 13.4 2.2 v -66.6 13.3 2.2 v -61.6 5.5 1.3 v -65.9 11.5 1.9 v -67.1 16.3 2.8 v -67.1 16.3 2.8 v -65.9 11.5 1.9 v -65.9 11.5 1.9 v -61.7 5.4 1.0 v -55.8 -2.6 -0.6 v -67.4 20.0 3.0 v -65.8 11.5 2.1 v -63.4 7.4 1.6 v -65.8 11.5 2.1 v -67.1 16.3 2.8 v -67.1 16.3 2.8 v -59.8 3.0 1.1 v -59.8 3.0 1.1 v -63.7 7.3 1.2 v -63.8 7.2 1.4 v -64.7 9.7 1.6 v -65.9 11.7 1.8 v -66.1 11.5 1.8 v -62.1 5.0 1.2 v -67.0 17.2 3.0 v -65.9 11.5 1.9 v -65.9 11.5 1.9 v -58.0 0.4 0.2 v -67.2 17.2 3.0 v -67.0 14.8 2.7 v -66.8 14.8 2.7 v -66.0 11.3 2.1 v -66.8 14.9 2.6 v -67.5 19.5 2.9 v -61.8 5.2 1.2 v -61.8 5.2 1.2 v -67.3 18.2 3.0 v -67.3 18.2 3.0 v -67.3 18.2 3.0 v -58.0 0.4 0.2 v -67.5 19.5 2.9 v -67.3 19.0 2.9 v -67.4 18.9 3.0 v -66.2 11.3 1.9 v -67.4 18.9 3.0 v -66.6 14.9 2.7 v -66.8 14.9 2.6 v -66.8 14.9 2.6 v -66.8 14.9 2.6 v -65.0 9.5 1.6 v -59.8 3.0 1.1 v -67.5 19.5 2.9 v -67.5 19.5 2.9 v -63.6 7.2 1.6 v -55.5 -2.3 -0.5 v -67.3 18.2 3.0 v -67.5 19.5 2.9 v -67.3 18.9 3.0 v -67.4 18.9 3.0 v -66.5 13.3 2.3 # 415 vertices
g Object05 f 1 2 3 f 4 5 6 f 7 8 9 f 10 11 12 f 13 6 14 f 15 16 17 f 18 19 20 f 21 22 23 f 24 25 26 f 27 28 29 f 30 31 32 f 33 34 35 f 36 37 38 f 39 40 41 f 42 43 44 f 8 45 46 f 47 48 49 f 50 51 52 f 53 54 55 f 56 57 36 f 58 59 60 f 61 30 32 f 62 41 63 f 59 64 42 f 65 66 67 f 68 69 70 f 71 72 73 f 74 75 30 f 76 77 78 f 79 80 81 f 82 83 84 f 72 85 73 f 86 87 88 f 89 90 91 f 92 93 94 f 95 96 97 f 96 74 97 f 85 98 99 f 100 101 102 f 103 104 105 f 106 107 108 f 102 109 110 f 98 111 112 f 113 114 115 f 116 117 113 f 118 119 120 f 121 122 123 f 82 124 83 f 125 126 76 f 127 128 129 f 130 131 132 f 133 134 135 f 129 136 137 f 138 62 139 f 52 15 17 f 140 95 141 f 142 143 144 f 145 146 147 f 148 135 149 f 150 151 152 f 153 154 155 f 156 157 158 f 87 159 160 f 161 4 13 f 20 19 1 f 138 162 62 f 163 164 165 f 166 47 167 f 168 169 170 f 171 172 173 f 174 125 175 f 176 128 127 f 51 15 52 f 177 178 179 f 88 87 160 f 102 110 180 f 90 181 182 f 183 184 185 f 186 187 188 f 189 190 80 f 23 22 71 f 6 163 191 f 163 192 164 f 193 194 195 f 196 146 145 f 70 142 197 f 180 110 198 f 143 199 156 f 200 189 79 f 160 159 201 f 202 203 204 f 71 73 205 f 206 89 207 f 208 134 133 f 169 209 170 f 210 211 212 f 199 157 156 f 136 213 214 f 215 208 216 f 48 24 154 f 217 70 197 f 191 163 165 f 218 219 220 f 221 222 223 f 91 90 182 f 97 74 30 f 224 18 225 f 226 227 228 f 229 230 231 f 11 232 233 f 234 65 213 f 235 86 88 f 236 237 238 f 239 240 241 f 242 240 239 f 114 243 115 f 244 7 245 f 246 124 82 f 247 248 249 f 222 250 251 f 252 117 116 f 253 138 139 f 254 207 255 f 120 119 256 f 257 122 121 f 32 31 168 f 207 89 91 f 258 259 260 f 46 261 262 f 209 263 95 f 179 166 167 f 264 265 266 f 248 29 249 f 185 184 267 f 131 268 269 f 270 179 271 f 112 272 273 f 201 274 275 f 167 49 276 f 277 130 278 f 279 280 281 f 282 283 284 f 285 186 188 f 139 62 63 f 127 129 286 f 287 100 288 f 37 238 289 f 290 291 292 f 136 234 213 f 144 143 293 f 14 6 191 f 294 229 295 f 296 216 297 f 216 133 297 f 240 13 241 f 197 142 144 f 298 299 300 f 289 238 53 f 213 67 301 f 273 272 302 f 151 303 304 f 29 28 222 f 28 250 222 f 276 49 153 f 305 186 285 f 3 224 225 f 159 274 201 f 181 103 306 f 216 208 133 f 307 175 308 f 272 23 302 f 309 310 282 f 83 138 253 f 75 311 31 f 164 312 242 f 141 97 61 f 223 251 290 f 128 313 129 f 310 283 282 f 192 312 164 f 314 177 270 f 315 281 316 f 302 23 317 f 245 7 9 f 318 264 266 f 303 319 304 f 251 291 290 f 320 321 322 f 119 323 256 f 41 40 107 f 165 164 324 f 265 325 326 f 228 210 212 f 271 167 276 f 327 158 328 f 329 10 330 f 142 331 143 f 281 280 332 f 227 210 228 f 272 21 23 f 154 24 26 f 100 102 288 f 308 175 333 f 334 335 336 f 328 337 217 f 76 126 77 f 338 51 50 f 331 199 143 f 339 329 330 f 316 332 339 f 188 340 341 f 17 16 342 f 110 343 196 f 344 345 346 f 347 257 121 f 54 348 298 f 349 100 287 f 281 332 316 f 213 65 67 f 259 350 260 f 351 307 308 f 352 101 100 f 11 353 232 f 238 237 54 f 31 311 169 f 77 200 79 f 109 343 110 f 179 167 271 f 184 354 267 f 355 92 291 f 194 127 195 f 67 66 194 f 278 130 132 f 12 11 233 f 67 194 193 f 283 202 284 f 135 305 285 f 5 192 163 f 353 279 232 f 356 357 146 f 73 99 358 f 108 82 84 f 164 242 324 f 321 334 359 f 156 158 327 f 64 43 42 f 195 127 286 f 360 361 354 f 62 39 41 f 362 320 363 f 364 112 273 f 311 365 169 f 149 285 366 f 367 254 255 f 190 174 307 f 368 64 59 f 242 369 240 f 177 179 270 f 49 48 154 f 370 183 371 f 269 372 373 f 324 242 239 f 359 334 336 f 36 57 37 f 374 375 264 f 126 200 77 f 376 44 318 f 80 190 307 f 188 187 340 f 133 135 148 f 322 321 359 f 307 174 175 f 325 59 58 f 241 13 14 f 80 307 351 f 105 254 367 f 232 279 281 f 377 91 378 f 147 349 287 f 66 176 194 f 379 162 138 f 155 26 314 f 300 36 380 f 288 102 180 f 291 92 94 f 25 178 177 f 381 382 363 f 295 229 231 f 293 156 327 f 383 244 245 f 250 355 251 f 292 94 247 f 230 345 344 f 363 382 362 f 384 300 380 f 385 386 329 f 30 75 31 f 330 10 12 f 387 105 367 f 16 388 342 f 115 243 389 f 122 390 123 f 124 379 83 f 297 133 148 f 333 76 78 f 391 118 120 f 390 118 391 f 123 390 391 f 392 393 394 f 178 166 179 f 143 156 293 f 42 44 376 f 261 395 262 f 233 232 315 f 366 188 341 f 396 252 116 f 175 76 333 f 158 397 337 f 274 398 275 f 399 306 387 f 207 91 377 f 400 86 235 f 262 395 383 f 395 244 383 f 386 401 10 f 402 338 50 f 112 111 272 f 94 93 248 f 306 103 105 f 299 56 300 f 35 294 295 f 158 337 328 f 175 125 76 f 343 356 196 f 38 37 289 f 358 99 364 f 45 261 46 f 403 404 402 f 99 112 364 f 312 369 242 f 320 362 322 f 157 397 158 f 264 375 265 f 388 404 403 f 194 176 127 f 49 154 153 f 172 405 173 f 361 370 371 f 167 47 49 f 97 30 61 f 406 277 278 f 268 372 269 f 380 36 38 f 298 300 384 f 254 206 207 f 135 285 149 f 371 183 185 f 104 206 254 f 389 407 408 f 409 368 325 f 187 215 340 f 209 95 140 f 336 335 381 f 162 39 62 f 346 410 33 f 340 216 296 f 19 2 1 f 146 357 349 f 37 236 238 f 83 379 138 f 63 41 106 f 107 246 82 f 337 68 70 f 203 309 204 f 255 207 377 f 154 26 155 f 411 392 394 f 306 105 387 f 214 213 301 f 146 349 147 f 84 83 253 f 332 329 339 f 251 355 291 f 408 412 396 f 137 136 214 f 91 182 378 f 401 353 11 f 335 382 381 f 240 161 13 f 249 29 221 f 265 409 325 f 129 313 136 f 34 294 35 f 317 71 205 f 369 161 240 f 43 374 44 f 95 97 141 f 13 4 6 f 237 348 54 f 280 385 332 f 342 388 403 f 397 68 337 f 266 265 326 f 222 251 223 f 77 79 413 f 59 42 60 f 10 401 11 f 404 338 402 f 134 305 135 f 105 104 254 f 41 107 106 f 414 400 235 f 231 230 344 f 275 398 414 f 93 27 248 f 40 246 107 f 44 264 318 f 313 234 136 f 44 374 264 f 238 54 53 f 232 281 315 f 349 352 100 f 301 67 193 f 325 368 59 f 341 340 296 f 291 94 292 f 326 325 58 f 285 188 366 f 248 27 29 f 286 129 137 f 398 400 414 f 340 215 216 f 323 257 347 f 256 323 347 f 243 407 389 f 412 252 396 f 70 69 142 f 26 177 314 f 110 196 198 f 300 56 36 f 101 109 102 f 413 79 81 f 29 222 221 f 196 356 146 f 81 80 351 f 60 42 376 f 263 96 95 f 170 209 140 f 365 263 209 f 57 236 37 f 332 385 329 f 107 82 108 f 345 410 346 f 31 169 168 f 198 196 145 f 78 77 413 f 410 34 33 f 169 365 209 f 69 331 142 f 182 181 306 f 182 306 399 f 99 98 112 f 372 406 373 f 94 248 247 f 26 25 177 f 22 72 71 f 415 150 152 f 55 298 384 f 205 73 358 f 73 85 99 f 6 5 163 f 337 70 217 f 54 298 55 f 23 71 317 f 79 189 80 f 357 352 349 f 378 182 399 f 111 21 272 f 375 409 265 f 329 386 10 f 348 299 298 # 481 faces
g
Falk Grieffenhagen.de wrote:
Hi list,
I currently have a little math problem:
I have a wavefront model (see below) which looks a bit like a stick. I want to set the position by 2 points in 3D (beginning and end) instead of one point, rotation , and scale. Any help would be great!!
i would do that in 2 steps: #1: normalize your stick (set length to 1.0, align it to an axis) #2: align the normalized stick to your 2 points
i demonstrated #1 in the attached patch. now the base of the stick is within the origin of the local coordinate system, while the tip is at (1/0/0). now #2 should be fairly simple: [translate] the stick to 1 point and rotate/scale it so that the 2nd point matches the end of the stick. the procedure is in fact the reverse of #1 (but the reference points have changed)
mfg.adsr. IOhannes
Hi IOannes,
Yes...this is how it works, thanks a lot
Gruss
Falk Am 30.11.2005 um 17:53 schrieb IOhannes m zmoelnig:
Falk Grieffenhagen.de wrote:
Hi list, I currently have a little math problem: I have a wavefront model (see below) which looks a bit like a stick. I want to set the position by 2 points in 3D (beginning and end) instead of one point, rotation , and scale. Any help would be great!!
i would do that in 2 steps: #1: normalize your stick (set length to 1.0, align it to an axis) #2: align the normalized stick to your 2 points
i demonstrated #1 in the attached patch. now the base of the stick is within the origin of the local coordinate system, while the tip is at (1/0/0). now #2 should be fairly simple: [translate] the stick to 1 point and rotate/scale it so that the 2nd point matches the end of the stick. the procedure is in fact the reverse of #1 (but the reference points have changed)
mfg.adsr. IOhannes
oops, i pressed the "Send" button instead of the "Attach"-button.
mfg.asdf IOhannes
#N canvas 413 247 867 633 10; #X obj 54 566 model; #X obj 112 518 openpanel; #X obj 109 491 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 54 19 gemhead; #X obj 532 318 sphere 0.05; #X obj 530 252 gemhead; #X obj 532 295 translateXYZ; #X floatatom 557 273 5 0 0 0 - - -; #X floatatom 598 272 5 0 0 0 - - -; #X floatatom 637 273 5 0 0 0 - - -; #X obj 521 409 sphere 0.05; #X obj 519 343 gemhead; #X obj 521 386 translateXYZ; #X floatatom 546 364 5 0 0 0 - - -; #X floatatom 587 363 5 0 0 0 - - -; #X floatatom 626 364 5 0 0 0 - - -; #X msg 234 63 create , reset , lighting 1 , 1; #X obj 297 146 gemwin; #X msg 448 61 destroy; #X obj 525 37 gemhead; #X obj 525 75 world_light; #X obj 381 36 sel 1; #X obj 234 31 loadbang; #X obj 379 6 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 118 547 symbol; #X obj 54 432 scale; #X msg 177 544 bang; #X msg 303 261 -67.6 20.1 2.9; #X msg 188 261 -53 -4.8 -2.2; #X obj 54 453 translate 1 0 0 0; #X obj 168 433 v* -1; #N canvas 0 0 450 300 sub3 0; #X obj 60 64 inlet; #X obj 113 206 outlet; #X obj 60 93 unpack 0 0 0; #X obj 200 64 inlet; #X obj 200 93 unpack 0 0 0; #X obj 110 173 pack 0 0 0; #X obj 105 147 -; #X obj 138 145 -; #X obj 171 148 -; #X connect 0 0 2 0; #X connect 2 0 6 0; #X connect 2 1 7 0; #X connect 2 2 8 0; #X connect 3 0 4 0; #X connect 4 0 6 1; #X connect 4 1 7 1; #X connect 4 2 8 1; #X connect 5 0 1 0; #X connect 6 0 5 0; #X connect 7 0 5 1; #X connect 8 0 5 2; #X restore 189 303 pd sub3; #X msg 103 408 1 $1; #X obj 103 430 /; #X obj 214 345 rad2deg; #X obj 270 344 rad2deg; #X obj 54 69 rotateXYZ; #X floatatom 118 38 5 0 0 0 - - -; #X obj 636 177 gemhead; #X floatatom 137 61 5 0 0 0 - - -; #X floatatom 136 87 5 0 0 0 - - -; #X obj 189 324 cart2sph; #X obj 214 366 * -1; #X obj 270 365 - 90; #X obj 54 385 rotate 0 1 0 0; #X obj 54 363 rotate 0 0 1 0; #X msg 124 571 rescale 0 , open $1; #X text 195 243 base; #X text 321 247 tip; #X floatatom 225 391 5 0 0 0 - - -; #X obj 54 329 rotate 180 0 1 0; #X obj 54 125 separator; #X text 71 182 normalize (length of stick:=1) , and align to X-axis ; #X text 264 572 turn rescaling off , so we know the size of the stick ; #X obj 188 224 t b b; #X msg 188 203 doit!; #X connect 1 0 24 0; #X connect 2 0 1 0; #X connect 3 0 36 0; #X connect 5 0 6 0; #X connect 6 0 4 0; #X connect 7 0 6 1; #X connect 8 0 6 2; #X connect 9 0 6 3; #X connect 11 0 12 0; #X connect 12 0 10 0; #X connect 13 0 12 1; #X connect 14 0 12 2; #X connect 15 0 12 3; #X connect 16 0 17 0; #X connect 18 0 17 0; #X connect 19 0 20 0; #X connect 21 0 16 0; #X connect 21 1 18 0; #X connect 22 0 16 0; #X connect 23 0 21 0; #X connect 24 0 46 0; #X connect 25 0 29 0; #X connect 26 0 24 0; #X connect 27 0 31 1; #X connect 28 0 30 0; #X connect 28 0 31 0; #X connect 29 0 0 0; #X connect 30 0 29 2; #X connect 31 0 41 0; #X connect 32 0 33 0; #X connect 33 0 25 1; #X connect 34 0 42 0; #X connect 35 0 43 0; #X connect 36 0 51 0; #X connect 37 0 36 1; #X connect 39 0 36 2; #X connect 40 0 36 3; #X connect 41 0 32 0; #X connect 41 1 34 0; #X connect 41 2 35 0; #X connect 42 0 45 1; #X connect 43 0 44 1; #X connect 44 0 25 0; #X connect 45 0 44 0; #X connect 46 0 0 0; #X connect 49 0 42 1; #X connect 50 0 45 0; #X connect 51 0 50 0; #X connect 54 0 28 0; #X connect 54 1 27 0; #X connect 55 0 54 0;