Sie sind nicht angemeldet.

Lieber Besucher, herzlich willkommen bei: krpano.com Forum. Falls dies Ihr erster Besuch auf dieser Seite ist, lesen Sie sich bitte die Hilfe durch. Dort wird Ihnen die Bedienung dieser Seite näher erläutert. Darüber hinaus sollten Sie sich registrieren, um alle Funktionen dieser Seite nutzen zu können. Benutzen Sie das Registrierungsformular, um sich zu registrieren oder informieren Sie sich ausführlich über den Registrierungsvorgang. Falls Sie sich bereits zu einem früheren Zeitpunkt registriert haben, können Sie sich hier anmelden.

1

Montag, 9. Oktober 2023, 06:22

How to obtain the 3D position (tx, ty, tz) of mouse clicks in a 3D model

I want to obtain the location of mouse clicks in 3D space and do something similar to adding hotspot


I saw this example on the official website:


https://krpano.com/releases/1.21/viewer/…xtured/test.xml


3D Measurements - between two points - can add hotspots to 3D models

But I don't know how to retrieve 3D coordinates through custom events. Can anyone tell me what to do ?

2

Dienstag, 10. Oktober 2023, 10:19

Hi,

use the screentodepth() and/or raycastdepth() actions:
https://krpano.com/docu/actions/?version=121#screentodepth
https://krpano.com/docu/actions/?version=121#raycastdepth

The depthmap_measure3d.xml is also just doing this:
https://krpano.com/viewsource.html?relea…p_measure3d.xml

E.g. (Javascript code):

Quellcode

1
2
3
4
5
var hit = krpano.actions.screentodepth(krpano.mouse.x, krpano.mouse.y);
if (hit)
{
  ...
}


Best regards,
Klaus

3

Mittwoch, 11. Oktober 2023, 09:05

It's working.
Thank you, Klaus.