Jump to content
Developer Wiki and Function Reference Links ×

2D screen co-ordinates of 3D points


Recommended Posts

  • Vectorworks, Inc Employee

Is there a way to obtain screen x/y co-ordinates of 3D points or loci? I want to place text objects at the centre of 3D objects but in screen plane. I can find the objects' centre and I can place a 3D Locus there, no problem. Now I want to either place a text object in 3D or on the screen plane but where the centre point of the 3D object is. Here's a fake result:

 

 598dc7dd58ea9_Bildschirmfoto2017-08-11um17_05_49.png.a44c12ad8df0f318bfbc246cfb3b3d1a.png

 

I want this to run as an executable Marionette, not as an object because I'm looking for a specific object type in the current layer to be labelled.

I cannot seem to find a node that will return the screen plane co-ordinates of a 3D point. Also, there seems to be no way to move a text object to a specified location in 3D space.

 

598dca17bc34d_Bildschirmfoto2017-08-11um17_15_22.png.e3b50a79c36f4931f365a38c09b99412.png

Link to comment
  • Marionette Maven

I'm not certain of a current node that will give you the screen plane location of a 3D point.

 

I do believe, however I haven't tested, that you can use the Move node to move the text to a 3D location. It would still exist on the layer plane, though, instead of the screen plane (if that even works)

 

I can look into this more for you.

Link to comment
  • Vectorworks, Inc Employee
1 minute ago, Marissa Farrell said:

I do believe, however I haven't tested, that you can use the Move node to move the text to a 3D location. It would still exist on the layer plane, though, instead of the screen plane (if that even works)

 

Thanks Marissa, but unfortunately, it doesn't seem to work. (In theory, I am doing that already by feeding pCenter into the text's position). But I have tried move also. To no avail.

Link to comment
  • Vectorworks, Inc Employee
6 hours ago, Alan Woodwell said:

@Stephan MoenninghoffHi, This network places text on screen plane or Layer Plane. Hope this helps?

001.vwx

Capture.JPG

Hi Alan,

Thanks for the help.

I cannot download your file - the link is broken. Just to clarify: I am not having problems placing text on the screen plane or on the layer plane. The Set Planar Reference node takes care of that. What I cannot do is place text on a point on the screen plane that is a projection of a 3D point.

Link to comment

I think the Vectorscript function you are looking for is ModelVecToScreenVec.  I am not on a machine with VW right now, but it is very possible that this is not a standard Node, but it should be fairly easy to make a custom node for it.

 

There are also a number of other VS functions for converting Working Plane to Screen Plane. Search the Function Reference for Screen.

Link to comment
  • Vectorworks, Inc Employee
7 hours ago, Alan Woodwell said:

As yo move the object you would need to have the screen plane object reposition itself.

Hi Alan, yes, that will be the next step, or, ideally, I want this to work inside the annotation space of viewports. Your example works but it converts text to polyline in the process. I understand why you need to do this. Text somehow cannot be moved in z. This was part of my problem.

@Pat Stanfordthanks for mentioning the VS function. Maybe this will do what I need. I'll have to play with it.

Link to comment
  • Marionette Maven

@Pat Stanford & @Stephan Moenninghoff

 

I've been through all of those functions and unfortunately I still haven't figured it out.

The locations returned all appear to be on the layer plane instead of in their 3D location projected to the screen. I don't think the function Pat mentioned takes the Z value into account, and I've struggled to find anything that can help offset that (which is why I was playing with the Layer Ref functions)

Link to comment
  • Vectorworks, Inc Employee
32 minutes ago, Marissa Farrell said:

@Pat Stanford & @Stephan Moenninghoff

 

I've been through all of those functions and unfortunately I still haven't figured it out.

The locations returned all appear to be on the layer plane instead of in their 3D location projected to the screen. I don't think the function Pat mentioned takes the Z value into account, and I've struggled to find anything that can help offset that (which is why I was playing with the Layer Ref functions)

OK, thanks, Marissa. I was just looking for a quick and dirty Marionette to fix a user problem. We'll probably have to code this properly in the SDK. Labelling parts in a drawing. Always a challenge :-)

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...