Nebeor Posted July 26, 2018 Share Posted July 26, 2018 I'm trying to transform a 3Dpoint in my drawing to a point in the screen, intuitively I would multiply with a (VW)TransformMatrix that should be easy to retrieve. I tried this: VWTransformMatrix viewMatrix; gSDK->GetViewMatrix(gSDK->GetActiveLayer(),viewMatrix); This line returns a empty (identity) matrix, even when i'm not in top view. I'm using an isometric perspective. What could I be doing wrong? Quote Link to comment
Nicolas Goutte Posted July 26, 2018 Share Posted July 26, 2018 (edited) Try to use TransformMatrix directly for the call as specified by http://developer.vectorworks.net/index.php/VCOM:VectorWorks:ISDK::GetViewMatrix Something like: TransformMatrix rawViewMatrix; gSDK->GetViewMatrix(gSDK->GetActiveLayer(),rawViewMatrix); // If needed, you can still make something like this afterwards: VWTransformMatrix viewMAtrix = rawViewMatrix; Edited July 26, 2018 by Nicolas Goutte 1 Quote Link to comment
Nebeor Posted July 26, 2018 Author Share Posted July 26, 2018 (edited) Thank you, This works, but i would like to understand he story behind TransformMatrix and VWTransformMatrix. What's compatible and what is not? Edited July 26, 2018 by Nebeor Quote Link to comment
Nicolas Goutte Posted July 26, 2018 Share Posted July 26, 2018 (edited) When you take the reference of VWTransformMatrix, you get the reference of a TransformMatrix that is inside VWTransformMatrix (to be exact: VWTransformMatrix::fMatrix). This matrix does get the correct value by the call gSDK->GetViewMatrix but this good matrix is never transferred to the main matrix data of VWTransformMatrix (to be exact: VWTransformMatrix::m). That is why you still get the identity matrix. So you have to explicitly set a TransformMatrix to the VWTransformMatrix to have what you want. This behavior was changed already in VWSDK 2016. From 2016 on, there is no "double bookkeeping" any more in the class. Edited July 26, 2018 by Nicolas Goutte Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.