Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all articles
Browse latest Browse all 8557

How to retrieve last transformation applied to custom grips?

$
0
0

@pagarcia wrote:

Hello,

I'm using the commands EnableGetGripPointXform(bool bEnable) and GetGripPointXform(ON_Xform& xform) to record the transformation applied by Translate, Rotate and Scale.

I need this transformation to be applied to an ON_3dPointArray points, member of my CRhinoObjectGrips class, to draw a mesh in CRhinoObjectGrips::Draw() and return it in CRhinoObjectGrips::NewObject().

The problem is that it seems that the transformations are being subsequently accumulated, thus the mesh blows away after some translation/rotation.
Ideally, the transform xform should forget about past transforms and just become the new one applied between last time the mesh was drawn and the most recent one (i.e. between subsequent calls of Draw()).

In my code so far, only when I create the grips m_grips[i] I call m_grips[i].EnableGetGripPointXform(true). Then, in Draw() and NewObject() (or inside my UpdateMesh() method) I write

m_grips[i].GetGripPointXform(xform);

and, for an index k depending on i, I update my mesh points

points[k].Transform(xform);

What am I missing?

Thanks for any help,
Pablo

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 8557

Trending Articles