Grab coordinates of an object via JS

Hello, is there a possibility for me to get the coordinates of an object via JS? my idea is to automate the creation of custom views, for example: I make a fecth in a json file, this file has the name of an object within the environment, then I take the coordinate of this object and create a view with this name and its coordinate, is it possible? Thank you in advance

Sorry, I just see that it works with nodeclick, thanks.
but I was wondering if there’s a way to work using fetch or when loading the environment get the coordinates of all the objects, or a list of objects

But there is a question I have that is not in the documentation, there is a way for me, in addition to getting the coordinates of the object, to take it, the direction of it so that the user is directed to the position and faces the object

You can compute the direction using the camera position and the object’s position. This way you can get the rotation that will be aligned with the direction from camera to the clicked object.

1 Like

I was able to find the findNodesOfType function, but I can’t get the coordinates

Is it possible to get the coordinates using findNodesOfType?

I am afraid there is no standard way to do this, unfortunately.

1 Like