Posts by Yaozefeng

• raycastdepth() expands the range of ray radius

I am using Krpano to create a collision warning function, which requires the use of raycastdepth().

On this basis, it is necessary to expand the radius range of the ray to provide collision warning within a radius of 1m, similar to THREE Raycaster. params Points. threshold.

Also, a limited range of rays is also what I need, I don't need infinitely long rays.

I checked the document and found that the corresponding function was not provided. I would like to ask if there is a solution.

Best wishes.

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

It's working.
Thank you, Klaus.

• 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/…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 ?

• Reverse engineering matteport coordinates

Hi,

after some testing - when using the threejs quaternion to euler functions,
then the order "ZXY" and the following depthmap.align mapping seems to fit:

depthmap.align = (x) | (z-90) | (-y)

Best regards,
Klaus

After my testing, I found that it can work

depthmap.align = (x) | (z-180) | (-y)

I'm not sure why it's -180. Can someone explain

• Reverse engineering matteport coordinates

threejs has some functions for it:

https://jsfiddle.net/sn15a60o/

I tried to convert quaternions to Euler angles, but the rotation angles of the model and panoramic image were incorrect when I included them in the krpano depthmap. My quaternion is:
Rotation:{
'x': -0.0012495082253
, "y": -0.005800439912
, "z": 0.5733134798673
, "w": 0.8193146205387
}

Converting to Euler angle is:
x: 0.300
y: -0.629
z: 69.958
But I need to set align="-0.0012495082253 | -110 | 0.005800439912" to work properly
My axis="- y+x+z", scale="100", origin="image"

• How to convert quaternions to depthmap.align

I am a newcomer to Krpano, and my panoramic image and OBJ model have directional deviations. I have quaternions for the direction of panoramic shooting, but I am not sure how to convert them into angles available for depthmap. align.

Code
``"rotation":{					"x":-0.0012495082253,					"y":-0.005800439912,					"z":0.5733134798673,					"w":0.8193146205387				}``

Code
``````<scene name="anjubao-13" title="anjubao-13" onstart="showmodelinfo('dollhouse.obj', 'OBJ');" lat="" lng="" alt="" heading="">        <view hlookat="0.0" vlookat="0.0" fovtype="MFOV" fov="120" maxpixelzoom="2.0" fovmin="70" fovmax="140" limitview="auto" />        <image ox="-446.8856357997" oy="0" oz="283.7837219605">            <sphere url="./anjubao/13.jpg" />            <depthmap url="anjubao/mesh.obj"                enabled="true"              rendermode="3dmodel"              scale="100"              origin="image"               axis="-y+x+z"              align="-0.0012495082253|-110|0.005800439912"            />        </image>
</scene>``````

align="-0.0012495082253|-110|0.005800439912"

It is right,but i dont not why.

I would greatly appreciate any answer.