Mouse interaction.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 07/09/2009 at 17:34, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   11 
    Platform:   Windows  ;   
    Language(s) :     C++  ;

    ---------
    Could someone point me in the right direction. I am building a tool for scultping. I want the mouse cursor location to effect the points on a given polygon object. I have gotten so that I can display the mouses coordinates on the viewport with this.

    > `

      
    \>  Bool SculptTool::MouseInput(BaseDocument *doc, BaseContainer &data;, BaseDraw *bd, EditorWindow *win, const BaseContainer &msg;)  
    \>  {  
    \>       if (!doc) return FALSE;  
    \>         
    \>       Real mx = msg.GetReal(BFM_INPUT_X);  
    \>       Real my = msg.GetReal(BFM_INPUT_Y);  
    \>       Real mz = msg.GetReal(BFM_INPUT_Z);  
    \>       LONG button;  
    \>    
    \>       switch (msg.GetLong(BFM_INPUT_CHANNEL))  
    \>       {  
    \>            case BFM_INPUT_MOUSELEFT : button=KEY_MLEFT; break;  
    \>            case BFM_INPUT_MOUSERIGHT: button=KEY_MRIGHT; break;  
    \>            default: return TRUE;  
    \>       }  
    \>    
    \>    
    \>       Real dx, dy;  
    \>       BaseContainer bc;  
    \>       BaseContainer device;  
    \>       win->MouseDragStart(button,mx,my,MOUSEDRAG_DONTHIDEMOUSE|MOUSEDRAG_NOMOVE);  
    \>       while (win->MouseDrag(&dx;,&dy;,&device;)==MOUSEDRAG_CONTINUE)  
    \>       {  
    \>    
    \>       GePrint("Mouse's X Position is: " + RealToString(mx));  
    \>       GePrint("Mouse's Y Position is: " + RealToString(my));  
    \>       GePrint("Mouse's Z Position is: " + RealToString(mz));  
    \>         
    \>       return TRUE;  
    \>       }  
    \>  }  
    \>  
    

    `

    how would I now get the points on the active object to react to the location of the mouse cursor?

    I really just need to be pushed in the right direction. Certainly don't want someone to do it for me.

    Thanks,

    ~Shawn



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/09/2009 at 01:23, xxxxxxxx wrote:

    Check out the ViewportSelect class. It is used the determine which points, edges or polygons are near the mouse cursor.

    Btw. that's quite an ambitious project, good luck.

    cheers,
    Matthias


Log in to reply