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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Converting from local to global coordinates

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 474 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

      On 31/03/2017 at 08:27, xxxxxxxx wrote:

      Hello plugincafe community 🙂

      I have a GeUserArea where I render the viewport (with Software renderer) as bitmap. I want to insert an object into the scene when I click on the image in the GeUserArea.

      The only thing I don't know is how to convert from my local coordinates to global. I have seen the Local2Global methods but they only apply to the Dialog/UserArea itself. Is there a way to do this?

      Have a nice weekend!

      regards,
      Florian

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

        On 03/04/2017 at 02:47, xxxxxxxx wrote:

        Hi Florian,

        in general the functions you are looking for are part of the BaseView class (BaseView.SW() and alike). You can get hold the BaseDraw (BaseView is derived thereof) via BaseDocument.GetRenderBaseDraw() or BaseDocument.GetActiveBaseDraw().
        In C++ docs we have a manual on BaseView and BaseDraw with a small chapter on Transformations.

        I see a potential problem with your dialog getting out of sync with the scene by the user changing for example the camera or the views. But this should be discussed in a different thread, if needed.

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

          On 06/04/2017 at 10:21, xxxxxxxx wrote:

          Hi Andreas,

          thanks for your reply! 
          There is just so much to learn about the docs 😄 I knew the BaseView /Draw classes but I dind't know they had those functions.

          And yeah, I guess that would be a problem, but I'll figure something out. Working with messages and rerendering my view to the dialog would be the easiest way I guess.

          greetings,
          Florian

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