|
Nakomis Lycia
woof
Join date: 14 Jan 2006
Posts: 28
|
08-25-2008 00:50
ok.. I'm trying to mirror some whiskers on an AV. I've custom positioned them with sphere's attached to the ends. I thought this would help me mirror them for the right side.. but I fail at that it seems. X3
I've been digging around here in the forums and found some stuff, but not enough to piece anything useful together.
I have all the parts, I just need a way to mirror the rotation of the sphere's on one side to the other side so that everything is even on both sides. (This way the linked whisker pieces are both the same on both sides)
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
08-25-2008 02:04
Try this (warning: not yet compiled; may need a few small syntax fixes): // Assumption: dir is a unit vector rotation mirrorRotAlong(rotation originalRot, vector dir) { vector oldFwd = llRot2Fwd(originalRot); vector oldLeft = llRot2Left(originalRot); vector oldUp = llRot2Up(originalRot);
vector newFwd = mirrorVecAlong(oldFwd, dir); vector newLeft = mirrorVecAlong(oldLeft, dir); vector newUp = mirrorVecAlong(oldUp, dir);
return Axes2Rot(newFwd, newLeft, newUp); }
// Assumption: dir is a unit vector rotation mirrorVecAlong(vector originalVec, vector dir) { float parallelComp = originalVec*dir; return originalVec - 2.0*parallelComp*dir; }
|
|
Ruthven Willenov
Darkness in your light
Join date: 16 Jan 2008
Posts: 965
|
08-25-2008 10:26
i assume you've tried this out? just though i'd point it out. usually works pretty well for me (with the exception of sculpties of course. /15/9a/38165/1.html what i tend to do otherwise if i want something the have the same radius around a center object is i'll line one up however i want it. shift drag to make a copy, ctrl+z to snap it back to the original position. link it to the center object. and then use the edit window to rotate the center object accordingly. maybe i'll work on a short video to better explain that
|
|
Nakomis Lycia
woof
Join date: 14 Jan 2006
Posts: 28
|
08-25-2008 11:01
From: Hewee Zetkin Try this (warning: not yet compiled; may need a few small syntax fixes): // Assumption: dir is a unit vector rotation mirrorRotAlong(rotation originalRot, vector dir) { vector oldFwd = llRot2Fwd(originalRot); vector oldLeft = llRot2Left(originalRot); vector oldUp = llRot2Up(originalRot);
vector newFwd = mirrorVecAlong(oldFwd, dir); vector newLeft = mirrorVecAlong(oldLeft, dir); vector newUp = mirrorVecAlong(oldUp, dir);
return Axes2Rot(newFwd, newLeft, newUp); }
// Assumption: dir is a unit vector rotation mirrorVecAlong(vector originalVec, vector dir) { float parallelComp = originalVec*dir; return originalVec - 2.0*parallelComp*dir; }
No idea what to do with thisk, sorry.. im not much into scripting 
|
|
Nakomis Lycia
woof
Join date: 14 Jan 2006
Posts: 28
|
08-25-2008 11:03
From: Ruthven Willenov i assume you've tried this out? just though i'd point it out. usually works pretty well for me (with the exception of sculpties of course. /15/9a/38165/1.html what i tend to do otherwise if i want something the have the same radius around a center object is i'll line one up however i want it. shift drag to make a copy, ctrl+z to snap it back to the original position. link it to the center object. and then use the edit window to rotate the center object accordingly. maybe i'll work on a short video to better explain that Yah, tried that, the results were rather flaky for what Im trying to do. I tried the Radius flip thing, but that doesn't seem to work either. That, or maybe I'm doing it wrong X3
|