ThreeJs Intersected point how to position in Unity

Hi,
I have been working on ‘threeJS’ project for a year now, and, really appreciate the hard work the team has put in making this 3D library so robust.

My question : Is it possible to use the threeJs’s ray casted intersected ‘point’ coordinates in Unity?
I will explain my use case:
In my threeJS project at runtime the user adds text/labels to a model in a scene by mouse click - so, raycast intersected point and place the text in the mouse click position of the model, ex. eye, limb. All good here.
This vector ‘point’ with the ‘label’ information is saved, and, later retrieved to display in threeJs scene and that works well.

However, now, I am trying to load the model and the label data in ‘Unity’ for viewing. The models are retrieved okay, but, the ‘points’ (that was ray casted in threejs) are not matching in ‘Unity’ - I need to place the labels in the same location / point that the user had saved in threeJS.
example :
{ point: {x:45.47, 483.4,-23.68},
label: “This is the eye”} }

Is this possible? Really appreciate if anyone has any idea on how this can be achieved!!
Thanks a lot!

Hi. The main difference you will find when working between ThreeJS and Unity is the coordinate systems are different:

ThreeJS uses right hand whereas Unity uses left hand. Hopefully all this means in your use case is you just negate the z-axis value from ThreeJS to Unity, however it could get more complex if you have translated the models around at all.

image strong text

3 Likes

Thanks heaps @calrk for the prompt response and such neat explanation.
Let me try to negate the z axis, and, I think there are some translation happening to the model in threeJs (which i did think could create an issue with Unity) .
Thanks again, as I wanted some expert to tell me what I am trying is possible - will have a go and update my finding.

Thanks