Hi Marzipanos :-),
I've a requirement for placing an hotspot in a specific location like the "perspective" demo of the outdoor in your demos....
but as it is right now (extra parameters rotations etc...), its rather complex to make it wright and place it correctly... very tedious process by hand...
So my requirements would be that the hotspot could receive a 4 points location and place it accordingly in a perspective way, insted of just one yaw/pitch.
- It could receive 4 yaw/pitch pairs or
- 4 points (x,y) in image/pano
Of course i know it must envolve some previous computation for the orthogonal/perspective transform.
But i've tried to devise a process on how to do it without luck and i'm a bit stuck here...
I've seen that in RectilinearView you have lots of goodies (projection, screenToCoordinates, coordinatesToScree, etc,,)
So i tried to create an aditional matrix3d inside the main div of the hotspot that would be responsible to do it. like..
<div class="hotspot" style="display: block; transform: !!##set by coordinatesToPerspectiveTransform##!!; position: absolute;">
<div id="areax" style="transform: matrix3d(....)">
...
</div>
</div>
I tried the computing of that matrix3d, by invert the parent one and then reconstruct the matrix from a projective transform such as in here:
https://codepen.io/fta/pen/ifnqH
The problem is that the hotspot has parent div has a css transform that you set in coordinatesToPerspectiveTransform and i just cant set the math right. ..or i'm just not seeing it..
Question: Can you provide me with some help, sample or direction on how to do it?
best regards,