Jump to content
Nebeor

gSDK->GetViewMatrix

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?

Share this post


Link to post

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

Share this post


Link to post

Thank you,

This works, but i would  like to understand he story behind TransformMatrix and VWTransformMatrix.

What's compatible and what is not?

Edited by Nebeor

Share this post


Link to post

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

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...