Page 1 of 1

Object in an Object

Posted: Thu Feb 27, 2014 12:04 am
by Hopki
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

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.

Re: Object in an Object

Posted: Fri Nov 03, 2017 8:36 pm
by TrBailey
I can't find out how to "Mouse Click => Set Text => Text: $hu => Target: popup_loader"

There is no "Set Text" action in Pano2vr

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

Re: Object in an Object

Posted: Wed Jan 10, 2018 3:21 pm
by JPeacock
Hi TrBailey,
As per your edit 2, did you find out how to work this with polygon hotspots in the end? Cheers, James :-)

Re: Object in an Object

Posted: Wed Jan 10, 2018 5:30 pm
by Hopki
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.