Jump to content
Developer Wiki and Function Reference Links Read more... ×
Stephan Moenninghoff

2D screen co-ordinates of 3D points

Recommended Posts

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

Share this post


Link to post

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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post

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.

Share this post


Link to post
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.

Share this post


Link to post

@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)

Share this post


Link to post
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 :-)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

 

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.

×