rotation settlement instruction vector


i've enactment algorithms internet while i can't seem work, i'm tossing doubt out here;



i am attempting news quickness settlement line point. sketch line isn't difficult: only insert line length velocity.length graph. puts line centered during indicate y-axis direction. need repremand series translation.



the translational settlement challenging calculate: half quickness vector. rotational matrix, however, being extremely interloper me. given directional settlement <x, y, z>, what's settlement i need?



edit 1: look; don't know question, substantially won't means give me an answer.



here i now have:



                    vector3f interpretation = new vector3f();
translation.scale(1f/2f, body.velocity);

vector3f vec_z = (vector3f) body.velocity.clone();
vec_z.normalize();

vector3f vec_y; // anxiety vector, repremand later
(vec_z.x == 0 && vec_z.z == 0) {
vec_y = new vector3f(-vec_z.y, 0f, 0f); // optimized
} else {
vec_y = new vector3f(0f, 1f, 0f);
}
vector3f vec_x = new vector3f();
vec_x.cross(vec_y, vec_z);
vec_z.normalize();

vec_y.cross(vec_x, vec_z);
vec_y.normalize();
vec_y.negate();

matrix3f series = new matrix3f(
vec_z.z, vec_z.x, vec_z.y,
vec_x.z, vec_x.x, vec_x.y,
vec_y.z, vec_y.x, vec_y.y
);

arrowtransform3d.set(rotation, translation, 1f);


based off . yes, i've attempted customary series settlement (vec_x.x, vec_y.x, etc) didn't work. i've rotating columns rows there's any effect.



edit 2:



apologies bold articulation comments.



so looks there multiple twin errors; residence md separate out (really bad controlling variables: vec_z indeed vec_y, on), i indispensable upset settlement before flitting off digest engine (transposing close!). run-down formula is:



                    vector3f vec_y = (vector3f) body.velocity.clone();
vec_y.normalize();

vector3f vec_x; // anxiety vector, repremand later
(vec_y.x == 0 && vec_y.z == 0) {
vec_x = new vector3f(-vec_y.y, 0f, 0f); // optimized
} else {
vec_x = new vector3f(0f, 1f, 0f);
}

vector3f vec_z = new vector3f();
vec_z.cross(vec_x, vec_y);
vec_z.normalize();

vec_x.cross(vec_z, vec_y);
vec_x.normalize();
vec_x.negate();

matrix3f series = new matrix3f(
vec_x.x, vec_x.y, vec_x.z,
vec_y.x, vec_y.y, vec_y.z,
vec_z.x, vec_z.y, vec_z.z
);
rotation.invert();


Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members