PDA

View Full Version : [C++] Custom tool - moving selected curve CVs


Inos
03-05-2011, 09:26 PM
Hello everyone,

I'm making a tool for manipulating NURBS curves, such that it selects the CVs around the mouse cursor, and then when dragging, it moves them accordingly.

So, I have the CVs in the SelectionList, and my question is how to correctly map the translation in the current view plane to 3D space and also how to actually change the coordinates of the CVs that are in the selection list.

Thanks in advance.
Inos

ganzo
03-06-2011, 03:37 AM
my question is how to correctly map the translation in the current view plane to 3D space...
Inos

Not sure if I understand and hope other people can correct me. I have never used the cursor in that way, but I assume you would have to do cursor->raster space->camera space -> world space? or something similar to that. Hope someone else can correct me if I'm wrong on this.

ticket01
03-06-2011, 04:57 PM
how to correctly map the translation in the current view plane to 3D space and also how to actually change the coordinates of the CVs that are in the selection list.

As ganzo guessed correctly you need to convert the various space information into each other. There are some convenience methods in M3dView to do this, like viewToWorld, its counterpart worldToView and viewToObjectSpace.

CGTalk Moderation
03-06-2011, 04:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.