You are not logged in.

  • "YASUSHI KUMON" started this thread

Posts: 92

Location: kanagawa,japan

Occupation: photographer

  • Send private message

1

Thursday, March 30th 2023, 7:45am

Drawing a Polygonal Hotspot with Holes

Hi,
I want to draw a polygonal hotspot with holes.

1) If I create a polygonal hotspot with a hole in a closed polygon, it will look like this.
I get a line connecting the hole and the surrounding area.
Also, the description of the points will be complicated.



Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<hotspot name="newhs_1" style="red">
    <point ath="-23.59629859770189" atv="-17.43463340109463" />
    <point ath="22.436074140747962" atv="-18.182171659622437" />
    <point ath="30.295746913954588" atv="20.54185542789286" />
    <point ath="-31.59922297890205" atv="20.407129486650785" />
    <point ath="-35.02511330485021" atv="5.64892236241984" />
    <point ath="-23.59629859770189" atv="-17.43463340109463" />    


    <point ath="-6.566921719565357" atv="-4.706035746700856" />
    <point ath="-7.359787462079169" atv="4.142787288940748" />
    <point ath="5.378572063604679" atv="4.954905810248095" />
    <point ath="5.777130951796664" atv="-4.394840878179481" />
    <point ath="-6.566921719565357" atv="-4.706035746700856" />
</hotspot>

<style name="red"
	  zorder="1"
       fillcolor="0xAA0000"
       fillalpha="0.5"
       borderwidth="3.0"
       bordercolor="0xFF0000"
       borderalpha="1.0"
       bordergradient=""
       borderzoom="0.0"
       />


2) If you create two polygonal hotspots, one for the whole area and the other for the hole, the two hotspots will be drawn overlapping.
It would be nice to be able to describe it this way in a style specification or something, but it doesn't work.



Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<hotspot name="newhs_1" style="red">
	<point ath="-23.59629859770189" atv="-17.43463340109463" />
	<point ath="22.436074140747962" atv="-18.182171659622437" />
	<point ath="30.295746913954588" atv="20.54185542789286" />
	<point ath="-31.59922297890205" atv="20.407129486650785" />
	<point ath="-35.02511330485021" atv="5.64892236241984" />
</hotspot>

<!-- -->
 <hotspot name="newhs_2" style="hole">
	<point ath="-6.566921719565357" atv="-4.706035746700856" />
	<point ath="5.777130951796664" atv="-4.394840878179481" />
	<point ath="5.378572063604679" atv="4.954905810248095" />
	<point ath="-7.359787462079169" atv="4.142787288940748" />
</hotspot>

    </scene>


<style name="red"
      zorder="1"
   	fillcolor="0xAA0000"
   	fillalpha="0.5"
   	borderwidth="3.0"
   	bordercolor="0xFF0000"
   	borderalpha="1.0"
   	bordergradient=""
   	borderzoom="0.0"
   	/>

<style name="hole"
      zorder="3"
      blendmode="add"
   	fillcolor="0x444444"
   	fillalpha="0.3"
   	borderwidth="3.0"
   	bordercolor="0x000000"
   	borderalpha="0.3"
   	bordergradient=""
   	borderzoom="0.0"/>


3) My ideal is this.



If anyone knows of a better way to do this, please let me know.


Thank you.

Tuur

Sage

Posts: 3,784

Location: Netherlands

Occupation: Krpano custom coding / Virtual Tours / Photography / Musician / Recording engineer

  • Send private message

2

Thursday, March 30th 2023, 9:24am

Hi Yasushi,

I use methode 1 with borderwidth 0
You can see it on my old drumset example 'Play with me' on the the big Ride cymbal for example.
https://www.virtualtuur.com/krpano/120/sound/drums/

Perhaps it is an option to use methode 1 with borderwidth 0 and make the borders as seperate poly's as polyline.. if you just have 1 of these hotspots or a few it could be an option? (Untested)

Tuur *thumbsup*

This post has been edited 1 times, last edit by "Tuur" (Mar 30th 2023, 10:00am)


  • "YASUSHI KUMON" started this thread

Posts: 92

Location: kanagawa,japan

Occupation: photographer

  • Send private message

3

Friday, March 31st 2023, 4:50am

Thank you Tuur.

That's one solution.

Actually, I'm looking for an easy way to draw polygons with complex shapes and multiple holes.

For example, it looks like this. (Convert from mesh to polygon)



In order to draw this hole, we need to make many cuts leading to the hole from the periphery.



I think it would be simpler if we could specify the entire contour and the holes as separate polygons, but is there a better way?
Thank you.