Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Screen to World matrix

 Post Reply Post Reply
Author
Message
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 89
Post Options Post Options   Quote rsodre Quote  Post ReplyReply Direct Link To This Post Topic: Screen to World matrix
    Posted: 2018 Aug 01 at 8:40pm

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
Back to Top
knickknack View Drop Down
Forum Moderator
Forum Moderator


Joined: 2016 Jul 01
Location: Italy
Online Status: Offline
Posts: 261
Post Options Post Options   Quote knickknack Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Aug 02 at 3:47am
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
MAXON Computer GmbH
SDK Support Team
Back to Top
rsodre View Drop Down
Member
Member


Joined: 2014 Jun 15
Location: Brazil
Online Status: Offline
Posts: 89
Post Options Post Options   Quote rsodre Quote  Post ReplyReply Direct Link To This Post Posted: 2018 Aug 02 at 6:45pm
Got it, thanks!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.094 seconds.