Hi
TranslationTransformation Regardless of your movement value, it will be at the (0,0,0)
The test code is as follows:
CRhinoGetObject go;
go.SetCommandPrompt(L"Select grips to move");
go.SetGeometryFilter(CRhinoGetObject::grip_object);
go.GetObjects(1, 0);
if (go.CommandResult() != success)
return go.CommandResult();
CRhinoXformObjectList list;
if (list.AddObjects(go, true) < 1)
return CRhinoCommand::failure;
CRhinoGetPoint gp;
gp.SetCommandPrompt(L"Point to move from");
gp.GetPoint();
if (gp.CommandResult() != success)
return gp.CommandResult();
ON_3dPoint from = gp.Point();
gp.SetCommandPrompt(L"Point to move to");
gp.SetBasePoint(from);
gp.DrawLineFromPoint(from, TRUE);
gp.GetPoint();
if (gp.CommandResult() != success)
return gp.CommandResult();
ON_3dPoint to = gp.Point();
ON_Xform xform;
xform.TranslationTransformation(to - from);
if (xform.IsValid())
{
// Transform the grip objects
int i;
for (i = 0; i < list.m_grips.Count(); i++)
{
CRhinoGripObject* grip = list.m_grips[i];
if (grip)
grip->MoveGrip(xform);
}
// Replace the old owner with a new one
for (i = 0; i < list.m_grip_owners.Count(); i++)
{
RhinoUpdateGripOwner(list.m_grip_owners[i], false, 0);
}
context.m_doc.Redraw();
}
return CRhinoCommand::success;