Object in an Object

Post Reply
User avatar
Hopki
Gnome
Posts: 12999
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

Hi,
As an idea you can put Object2VR popups in an Object2VR project.
This is an HTML5 project and uses a text box with iFrame code to display the embedded object.

How this works is very simple, in this example the main Object (Robot) is produced in the main project folder. Then the popup object (Reindeer) is in a sub fielder called popup.

The project for the popup outputs the files in the output folder of the main project. This is done by changing the file path, example:

Code: Select all

../output/popup/popup_out.xml
The ../ means go up a level in the file tree, then in the output folder make a folder called popup then place the popup_out.xml file in there.
A similar path is also in the HTML tab for the HTML page to be exported to the popup folder.

The other key point for the popup object is that it's HTML page needs to be set to fullscreen.
The popup object also has a basic skin and a double click enter fullscreen set in the advanced settings.

The main object has the iFrame code in the Hotspot editors URL text field, the code this project is using is:

Code: Select all

<iframe src="popup/popup.html" width="200px" height="261px" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" frameborder="0"></iframe>
This has the advantage that each Hotspot can have a different popup object.

Use the same code for your own projects but make sure you enter the correct file path to the popup objects HTML page and you set the size in the iFrame code to match the size of the text box that will display it.

In the skin for the main Robot object there is a hotspot template that has the actions:
Mouse Click => Show Element => popup_background
Mouse Click => Set Text => Text: $hu => Target: popup_loader

The popup_background is the ID of a rectangle used as the background for the text box that will display the popup object.
The text box and rectangle opens together as the text box is a child of the rectangle. The next action sets the text for the text box, the place holder $hu uses the iFrame code entered in the Hotspots URL text field. This means each Hotspot can have it sown iFrame code/popup object.

There is also a close button that hides the popup_background and also has a set text action which removes the iFrame code from the text box to "unload" it. This is needed if you have more than one popup object in your project as you may see briefly the last popup before the new popup is displayed.

Both the Robot and Reindeer have the double click toggle fullscreen selected in the advanced settings tab.
If you double click the main object it will enter fullscreen. If you open the popup object and double click, this will also go fullscreen. Please note the Robot has to exit fullscreen before the Reindeer object can enter fullscreen.

If you don't want another object you can use Object2VR to create animations to show part of the object that moves.
As an example a rotating box, rotate the box, then have a hotspot to show a popup showing the lid opening and closing.

Object2VR is a very powerful peace of software and with a little inspiration and out of the box thinking can be use to create some stunning presentations.
Regards,
Hopki
Attachments
oio.zip
(2.48 MiB) Downloaded 1364 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/
TrBailey
Posts: 43
Joined: Fri Jul 10, 2015 5:32 pm

I can't find out how to "Mouse Click => Set Text => Text: $hu => Target: popup_loader"

There is no "Set Text" action in Pano2vr

EDIT:
Nevermind, got it working :)

I was assuming it was "set value (and it was) I just needed to make my text box larger


Edit 2:
Is there a way to do it with polygon hotspots? I don't have a skin-id option when I make a polygon hotspot
JPeacock
Posts: 9
Joined: Fri Dec 22, 2017 12:59 pm

Hi TrBailey,
As per your edit 2, did you find out how to work this with polygon hotspots in the end? Cheers, James :-)
User avatar
Hopki
Gnome
Posts: 12999
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

You can use a Hotspot Proxy ID.
So add the required actions to a container then under the Advanced tab of the container you will see Hotspot Proxy ID, add the ID of the Poly Hotspot.
When clicked all the actions in the container will be actioned.
Of course you can change the ID of the Poly hotspot to say pop01, pop02 etc.
Regards,
Hopki
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