Processing Forum
Does this make sense?
My goal is to make my hip the origin of ordinates. As there's only hip_left and hip_right given in a PVector, I calculate the middle. calculateAngleBetweenPoints means angle between imaginary lines of P1-P2 and P2-P3. Normal_ are normal vectors. I use the center of the knee to the center of the hip to form a rough normal to the ground.
Oh and why does point() not work if size(width,height,opengl) instead of size(width,height)?pushMatrix();
hip.x = (hip_left.x+hip_right.x)/2;
hip.y = (hip_left.y+hip_right.y)/2;
hip.z = (hip_left.z+hip_right.z)/2;
knee.x = (knee_left.x+knee_right.x)/2;
knee.y = (knee_left.y+knee_right.y)/2;
knee.z = (knee_left.z+knee_right.z)/2;
HelperVector.x = hip.x * Normal_x.x;
HelperVector.y = hip.y * Normal_x.y;
HelperVector.z = hip.z * Normal_x.z;
rotateY(radians(calculateAngleBetweenPoints(HelperVector, hip, hip_left)));
HelperVector.x = -(knee.x - hip.x);
HelperVector.y = -(knee.y - hip.y);
HelperVector.z = -(knee.z - hip.z);
rotateX(radians(calculateAngleBetweenPoints(HelperVector, hip, Normal_y)));
translate(hip.x,hip.y,hip.z);
Is there something like that in processing?heapq.nlargest(n, iterable[, key])
Return a list with the n largest elements from the dataset defined by iterable. key, if provided, specifies a function of one argument that is used to extract a comparison key from each element in the iterable: key=str.lower Equivalent to: sorted(iterable, key=key, reverse=True)[:n]