Hi Folks!
I have made a 3D least squares aproximation system (wich i'll publish later), so
testing it I found the function plotter coordinates orientation are "wrong".
The point is to discuss what is wrong.
k3d/modules/plot/surface_plotter.cpp
For instance when we have PZ value
case k3d::PZ:
i = k3d::vector3(-1, 0, 0);
j = k3d::vector3(0, -1, 0);
k = k3d::vector3(0, 0, 1);
This make the functions mirrored
i would expect this
case k3d::PZ:
i = k3d::vector3(1, 0, 0);
j = k3d::vector3(0, 1, 0);
k = k3d::vector3(0, 0, 1);
So they are aligned with the X,Y and Z
So I proposed a method for of standarize how to choose the i and j vector since
the k vector is quite obvios (K is always PX,NX...PZ,NZ)
When the orientation of the k vector is positive i and j should also positive.
When the orientation of the k vector is negative it must be a 180 ºrotation
around the i axis. (so i always remain the same in negative an positive for a
specific k)
Here is the result.
case k3d::PX:
i = k3d::vector3(0, 1, 0);
j = k3d::vector3(0, 0, 1);
k = k3d::vector3(1, 0, 0);
break;
case k3d::NX:
i = k3d::vector3(0, 1, 0);
j = k3d::vector3(0, 0, -1);
k = k3d::vector3(-1, 0, 0);
break;
case k3d::PY:
i = k3d::vector3(0, 0, 1);
j = k3d::vector3(1, 0, 0);
k = k3d::vector3(0, 1, 0);
break;
case k3d::NY:
i = k3d::vector3(0, 0, 1);
j = k3d::vector3(-1, 0, 0);
k = k3d::vector3(0, -1, 0);
break;
case k3d::PZ:
i = k3d::vector3(1, 0, 0);
j = k3d::vector3(0, 1, 0);
k = k3d::vector3(0, 0, 1);
break;
case k3d::NZ:
i = k3d::vector3(1, 0, 0);
j = k3d::vector3(0, -1, 0);
k = k3d::vector3(0, 0, -1);
break;
Cheers!
Joaquín
|