Converting from local to global coordinates



  • 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



  • 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.



  • 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 :D 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


Log in to reply