Saurabh Agrawal
Saurabh Agrawal

Reputation: 190

Get the world coordinates of a markup in Forge

I am trying to get the world coordinates( i.e. viewer coordinate) of a markups position. But I am unable to get It.

What I am doing:

In case of Arrow:-

I have drawn an arrow and I am getting its head and tail. Then I am trying to convert it to world client using viewer.clientToWorld as shown below

enter image description here

enter image description here In Above screen shot m is my markup

enter image description here

Reason I am doing this is that I want to set a cutPlane in viewer which is exactly parallel to my markup.

Also suggest how can I find a plane which is parallel to the line and will be along z axis.

Thanks & Regards

Saurabh A.

Upvotes: 1

Views: 428

Answers (1)

Bryan Huang
Bryan Huang

Reputation: 5342

viewer.clientToWorld could only get you the world positions when the client coords intersect a node (a point/part of the model).

To get world positions when the client coords are not intersecting see here

Upvotes: 1

Related Questions