Keyboard 'Forward\Up' goes to Polygon node in center of view

Q&A about the latest versions
Post Reply
Lightyears
Posts: 8
Joined: Tue Oct 25, 2022 10:44 am

*BUMPING: to see if anyone has any ideas*

Hi all.

Trying to create some keyboard controls so users can "walk" to next node in front of them by pressing 'up'.

I was able to get point nodes working out when they're in the center using a 'distance from edge' variable.

However our implementation uses polygon nodes to give large clickable areas.
I'm trying to 'click' them when we use the up key.

Initially I tried simulating 'up' using javascript as a click action, but for (reasonably obvious) security reasons, that didn't really count as a click to the browser.

Code: Select all

let evt = new MouseEvent("click", {
	bubbles: true,
	cancelable: true,
	view: window,
	screenX: screen.width/2,
	screenY: screen.height/2
});
cb.dispatchEvent(evt);
An example of our project using Polygonal hotspots is here
https://gabrielsaunders.com.au/VR/jolimont-poly/
Click mouse on large polygonal hotspots gives the impression if stepping through the space etc etc.

I tried accessing the hotspots and creating an intersecting div in the middle of the screen, but I also can't see any way to list all the polygonal hotspots via the Javascript API.
The point hotspots exist, and I could theoretically get javascript to click one.
But can't for the life of me work out how to get polygonal hotspots in Javascript, and click one.

The proxyID allowed me to get the nodeID when the mouse is hovering over it, which could then feed into JS for a 'click' event.
But we need this to work independent of mouse position, and instead use "screen center".

Any ideas?
Last edited by Lightyears on Wed Jul 05, 2023 3:14 am, edited 1 time in total.
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
The topic has been moved to the Pano2VR forum.
Of course, it depends on your thoughts on what is a larger clickable area, but I would be inclined to add a rectangle to a point hotspot.
You can make it alpha 0.001 so it's active but invisible then make its size to whatever you want including adding rounded corners, for example, 200 x 100px giving a much larger clickable area.
Then you can use your original idea using a point hotspot.
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/
Lightyears
Posts: 8
Joined: Tue Oct 25, 2022 10:44 am

Getting 'Keyboard up' to move into the node in front of the user is the issue.

I originally built this with point hotspots, creating a circle\rectangle invisible element to increase their click area size.
However, the problem with the point hotspots is that they block the mouse\pointer cursor.

So the Pano can't rotate if you click\touch in the point hotspot area, as it's sitting above the background.
This doesn't happen with the polygon hotspots.

In either case, does anyone have an idea on how to work out what node is in the middle(ish) of the view, without using a mouse cursor interaction (I.E. over, mouseenter etc).
And if yes, does it work for Polygonal hotspots?
Lightyears
Posts: 8
Joined: Tue Oct 25, 2022 10:44 am

Hopki wrote: Tue Jun 20, 2023 12:58 pm Hi,
The topic has been moved to the Pano2VR forum.
Of course, it depends on your thoughts on what is a larger clickable area, but I would be inclined to add a rectangle to a point hotspot.
You can make it alpha 0.001 so it's active but invisible then make its size to whatever you want including adding rounded corners, for example, 200 x 100px giving a much larger clickable area.
Then you can use your original idea using a point hotspot.
Regards,
Sadly not a work-able solution, as using Hotspot points with a 'hidden rectangle' as a clickable area blocks the click+drag rotation of the scene. Essentially getting in the way of the user looking around the pano.
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

The only thing I can think of is to have a hidden container that has the action Open Next Panorama with Target, forward.
The container can use the keyboard arrow up button.
This of course would advance the panoramas regardless of which direction you were looking.

You could get clever and add a Point Hotspot with a Custom Property that changes true and false when set between 40% in the panorama.
This would have a nonactive element, say a container to act as the hotspot image, this would not be seen in the output.
The container would have actions to change a normal variable which can then be used as an action filter.

Please see the attached project, note the keyboard arrow pan left and right with the up arrow key changing nodes when the action filter is true.

So after you add your polygon hotspot just add a point hotspot in the middle.
Regards,
Attachments
project.zip
(25.36 KiB) Downloaded 75 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/
Lightyears
Posts: 8
Joined: Tue Oct 25, 2022 10:44 am

Hopki wrote: Wed Jul 05, 2023 3:59 pm The only thing I can think of is to have a hidden container that has the action Open Next Panorama with Target, forward.
The container can use the keyboard arrow up button.
This of course would advance the panoramas regardless of which direction you were looking.

You could get clever and add a Point Hotspot with a Custom Property that changes true and false when set between 40% in the panorama.
This would have a nonactive element, say a container to act as the hotspot image, this would not be seen in the output.
The container would have actions to change a normal variable which can then be used as an action filter.

Please see the attached project, note the keyboard arrow pan left and right with the up arrow key changing nodes when the action filter is true.

So after you add your polygon hotspot just add a point hotspot in the middle.
Regards,
Thanks so much for putting a project together, that was unexpected and nice of you!
I'll see if I can get it working how the client wants.
Lightyears
Posts: 8
Joined: Tue Oct 25, 2022 10:44 am

Just updating everyone.

I wasn't able to get this functionality working sadly.
User avatar
Hopki
Gnome
Posts: 13029
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

We have added this as a feature request.
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/
Post Reply