- Выберите точку.
- Поверните.
- Выберите другую точку.
Вот вот как это выглядит:
Видео
Я пытался следовать порядку: Перевести(x,y,z) -> Повернуть -> Перевести(-x,-y,- z)
Вот код
GL.MatrixMode(MatrixMode.Modelview);
GL.Translate(transX, transY, 0);
GL.PushMatrix();
if (rotatePoint != null)
{
// Draw clicked point
GL.PointSize(30);
GL.Begin(PrimitiveType.Points);
GL.Color3(1.0, 0.0, 0.0);
GL.Vertex3(rotatePoint.point.X, rotatePoint.point.Y, rotatePoint.point.Z);
GL.End();
// Translate to the rotatePoint
GL.Translate(rotatePoint.point.X, rotatePoint.point.Y, rotatePoint.point.Z);
GL.Rotate(angleY, 1, 0, 0);
GL.Rotate(-angleX, 0, 1, 0);
// Translate back
GL.Translate(-rotatePoint.point.X, -rotatePoint.point.Y, -rotatePoint.point.Z);
}
SetupViewport();
pco.Render(point_size, ShowOctreeOutline, PointCloudColor, mFrustum);
GL.PopMatrix();
SetupViewport:
int w = glControl1.ClientSize.Width;
int h = glControl1.ClientSize.Height;
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
float aspect = w / (float)h;
float n = scaling;
float left = -n * 0.5f, right = n * 0.5f, down = -n * 0.5f / aspect, up = n * 0.5f / aspect;
if (w
Подробнее здесь: https://stackoverflow.com/questions/787 ... k-position