Flat Rotating Hotspot

Special forum to share and discuss skins for Pano2VR and Object2VR
Post Reply
User avatar
Hopki
Gnome
Posts: 13546
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
This was a solution for a customer request for a flat rotating hotspot.
A working project is attached below.

example.gif
example.gif (2.75 MiB) Viewed 32650 times

It uses CSS and a graphic made in Photoshop but can be any graphic you want to use.

How it was built.
Starting with a new skin add a Hotspot Template

1.png
1.png (57 KiB) Viewed 32650 times

Then give it the ID ht_node so it will be used by the Hotspot Type Node.
Then make your image a child of the Hotspot, I am using the ID ht_image

2.png
2.png (24.5 KiB) Viewed 32650 times

Give the Hotspot Template the action to open the next panorama

2_1.png
2_1.png (37.95 KiB) Viewed 32650 times

Then you need to set the Modifier so it scales with FoV (zoom)

2_2.png
2_2.png (40.48 KiB) Viewed 32650 times

Set the images Anchor to centre and set position to X/Y to 0/0px so it is now on top of the Hotspot Template in the Skin Canvas.

3.png
3.png (48.55 KiB) Viewed 32650 times

A Text Box has also been added for a tooltip but this is optional.
The text box is using the placeholder $(hs) so it displays the Hotspot Title and has a visible logic block so it shows when the Mouse is Over Parent.


To make the image rotate you need to copy and paste this code into the Skins Embedded Stylesheet.

Code: Select all

@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(359deg);
  }
}

So it looks like this:

4.png
4.png (38.55 KiB) Viewed 32650 times

Now select the image ht_image in the skin and select CSS Styles Inner Element and add:

Code: Select all

animation: rotation 2s infinite linear;
5.png
5.png (22.18 KiB) Viewed 32650 times

You can adjust the speed, it is how long it takes to rotate once so the larger the number the slower it will rotate.


To make it look flat on the floor the X-axis of the image needs to be changed.
To do this select CSS Styles in the image's properties and add the code:

Code: Select all

transform: rotateX(255deg);
6.png
6.png (21.38 KiB) Viewed 32649 times

Again you can change the setting to make it look flat depending on the height you set your Hotspots.


There is now a new version for Pano2VR 7.

Regards,
Attachments
FlatRotatingHotspot_V7.zip
(3.63 MiB) Downloaded 792 times
FlatRotatingHotspot.zip
(3.63 MiB) Downloaded 1033 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
miskokral
Posts: 1
Joined: Mon Oct 11, 2021 8:14 pm

I tried this sample however the shape does not follow the movement of the camera in terms of its shape. It is rather elliptical than a circle when the hotspot is under or very close to the camera.
Could we have a hotspot glued to the ground and the shape will act like the floating cursor you have created before?
To be clear I would like to have the Matterport Hotspot effect on my tours.
Attachments
Screenshot_1.jpg
Screenshot_1.jpg (299.83 KiB) Viewed 30086 times
User avatar
Hopki
Gnome
Posts: 13546
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi miskokral,
Have you seen this webinar?
https://ggnome.com/gg_webinars/3d-floating-cursor/
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
MPW
Posts: 138
Joined: Wed Mar 06, 2013 4:22 pm
Location: Germany

Hi,
I like this hotspot and maybe it can solve my problem, too.

Is it possible to get a north-oriented rotation instead of the continously 360 rotation?

The reason for this:

I´ve a dotted line on the floor, being a hotspot and leading to the next pano.
I could use the tilt css for my svg, to get the optical impression of being painted on the ground. When moving the pano, the line has to keep the orientation to the pano, to show the right direction.
However any modifier (rotation to the svg or the hs) did not work. Probably it must be a css code for the inner style, too.
Which painfully reminds me of my lack of knowledge about css :(

Thanks for any help.
hkreslone
Posts: 9
Joined: Mon Mar 22, 2021 2:12 pm

Hi,
I am trying to use this method for creating 'Matterport' or Google Street View style hot spots. I have close to zero skills in JS. Can You provide the JavaScript code that transforms Hot spot image so it looks like flat laying on the ground? and changing according to perspective angle of view, zoom, So in theory I need code that is used for floating cursor but for Hot Spot.
Thank You for any help.
User avatar
Hopki
Gnome
Posts: 13546
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
In the first post see:
To make it look flat on the floor the X-axis of the image needs to be changed.
To do this select CSS Styles in the image's properties and add the code:

transform: rotateX(255deg);
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
hkreslone
Posts: 9
Joined: Mon Mar 22, 2021 2:12 pm

Thank You for fast response.
This is not the effect I am looking for. As this is static. If you change the perspective, the image static. Floating cursor on the other hand is bigger when it is closer, smaller when further away and the angle of it changes accordingly. It looks 'exactly' as if it placed in real life. If I am not clear I will add some images.
With regards
User avatar
Hopki
Gnome
Posts: 13546
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Have a look at this skin.
Is this closer to what you are looking for?
Attachments
skin.ggsk
(1.78 KiB) Downloaded 518 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
hkreslone
Posts: 9
Joined: Mon Mar 22, 2021 2:12 pm

Thank You again for fast answer.
First I have to say, that I have the best forum experience in my whole life (over 41 so still young).
Back to the topic. We are missing the point. So I will try to explain a bit more - images plus small description should be helpful.

1. Solution from Your skin
Your hot spot.png
Your hot spot.png (2 MiB) Viewed 24235 times
2. Effect I want to achieve - hot spots looks like green rings (I used floating cursor to show the effect):
Effect I want to achive hs1.png
Effect I want to achive hs1.png (2.01 MiB) Viewed 24235 times
Effect I want to achive hs2.png
Effect I want to achive hs2.png (1.94 MiB) Viewed 24235 times
You see de difference and need of JS to transform the look of hot spots.

3. Small description:
I make VT of exhibition. I have ~110 nodes in one closed space. The idea is to show every element of exhibition standing in front of it. So i have often Tour nodes very close to each other ~1.5-2 meters of distance. This type of hot spot clearly points where You will "be standing" after clicking. So the hot spots should look like semitransparent circles painted on the floor. So hot spot's circles that are close to the view point should be more round and bigger and the one that are further away should appear as smaller and flattened (different angle of view). Exactly like floating cursor looks. As I understand I need JS for that. Very similar to the one that is used in floating cursor. Can You help me with this problem.

Best regards
hkreslone
User avatar
Hopki
Gnome
Posts: 13546
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi hkreslone,
Have a look at the attched, its not full funtionmal but concintrates on cursor vs Point Hotspots.
Have a look.
Regards,
Attachments
project.zip
(26.26 KiB) Downloaded 525 times
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
hkreslone
Posts: 9
Joined: Mon Mar 22, 2021 2:12 pm

Again than You for Your response but we are at the same spot.
Probably beacose of my poor explanation of my problem.
I will try again.
You have floating cursor that has his image circle changing with position on the screen (closer to point o view is bigger and more round - as we look at it almost directly from above). And Hot spots that You provided do not change with the perspective they are static - same size and same angle - transformX(255).


The effect I want to achive:
Imagine in real life we are standing in the middle of the flat surface. I have real hot spot images in my hand - 1 meter in diameter paper circles. When I place one 1 meter from me it looks for my eyes almost round and quite big. The second one 10 meters from me looks smaller and its not as round - different angle of view. The one that is 50 meters from me is really small and looks closer to line as it is far away.

So I want the hot spot circles to appear exaclty the same as floating cursor circle from your example when both are placed in the same spot on the screen. So I need the way and formula that will transform image circle (rotateX and scale) of the hot spot image as function of tilt (I think it is the tilt parameter, but i can be wrong).

With regards
hkreslone

PS. How can I get hot spot tilt value with JS?
Post Reply