Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Register
    • Login

    Screen to World matrix

    SDK Help
    0
    3
    909
    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
      Helper
      last edited by

      On 01/08/2018 at 20:40, xxxxxxxx wrote:

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

      ---------
      Hi,

      I'm using a library that needs the Viewport to World transform matrix.

      I know BaseView::WS() can be used to convert such coordinate, but I can't find anywhere the Matrix used by it.

      BaseView::GetMg() is clearly is the Camera matrix, not Screen, and since we have also CS() and SC(), there must be a missing matrix somewhere.

      Thanks

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

        On 02/08/2018 at 03:47, xxxxxxxx wrote:

        Hi rsodre, thanks for writing us.

        With regard to your question, you can consider to use BaseView::GetMG() to get the view matrix as well the BaseDraw::GetViewMatrix(DRAW_GET_VIEWMATRIX_PROJECTION) to get the projection matrix. From this point on you are provided with all the bricks to construct your needed matrix.
        Further details on view/projection/model matrix composition can be found here.

        Best, Riccardo

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

          On 02/08/2018 at 18:45, xxxxxxxx wrote:

          Got it, thanks!

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