Jump to content
Developer Wiki and Function Reference Links ×

gSDK->GetViewMatrix


Nebeor

Recommended Posts

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?

Link to comment

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 by Nicolas Goutte
  • Like 1
Link to comment

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 by Nicolas Goutte
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...