Vectorworks, Inc Employee Stephan Moenninghoff Posted August 11, 2017 Vectorworks, Inc Employee Share Posted August 11, 2017 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: 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. Quote Link to comment
Marionette Maven Marissa Farrell Posted August 11, 2017 Marionette Maven Share Posted August 11, 2017 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. Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted August 11, 2017 Author Vectorworks, Inc Employee Share Posted August 11, 2017 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. Quote Link to comment
Marionette Maven Marissa Farrell Posted August 11, 2017 Marionette Maven Share Posted August 11, 2017 Well I got close (but not close enough, no screen plane) I had to write the new nodes. I'll keep looking for a screen plane solution, though. just not sure one exists. MoveObjToPlane_v2017.vwx Quote Link to comment
AlanW Posted August 13, 2017 Share Posted August 13, 2017 @Stephan MoenninghoffHi, This network places text on screen plane or Layer Plane. Hope this helps? 001.vwx Quote Link to comment
AlanW Posted August 13, 2017 Share Posted August 13, 2017 (edited) o Edited August 13, 2017 by Alan Woodwell Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted August 13, 2017 Author Vectorworks, Inc Employee Share Posted August 13, 2017 6 hours ago, Alan Woodwell said: @Stephan MoenninghoffHi, This network places text on screen plane or Layer Plane. Hope this helps? 001.vwx 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. Quote Link to comment
AlanW Posted August 13, 2017 Share Posted August 13, 2017 @Stephan MoenninghoffI see the issue, setting text to a 3d point is ok but directly above a 3d object in screen plane? as yo move the object you would need to have the screen plane object reposition itself. What i have so far. will play more. Text on screen plane.vwx Quote Link to comment
Pat Stanford Posted August 14, 2017 Share Posted August 14, 2017 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. Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted August 14, 2017 Author Vectorworks, Inc Employee Share Posted August 14, 2017 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. Quote Link to comment
Marionette Maven Marissa Farrell Posted August 14, 2017 Marionette Maven Share Posted August 14, 2017 @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) Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted August 14, 2017 Author Vectorworks, Inc Employee Share Posted August 14, 2017 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 :-) Quote Link to comment
AlanW Posted August 14, 2017 Share Posted August 14, 2017 @Stephan MoenninghoffHi, Still playing. This one places the text on the face of the object and follows it around. Text on Object.vwx 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.