Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Mouse interaction.

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 196 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post