You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, December 21st 2021, 10:54pm

Dynamic XML for thausands floorplans

Hello there,

I'm pretty new here, we are thinking to switch A-frame to KRPano, was doing long research, previous try like 2years ago was -> ugh XML and pretty uncommon creation, especially for React, or PWA developer. Anyway i wanted to ask if there is an option to KRPANO be prepared for feching data with an XML for floorplans all data inside, so spheres, links between then, hotspots etc. What we want to achiev is to create one App, that will receive in that case XML, or JSON and XML with all data depend on URL, so www/investmentX/apartment1 will have different data than www/investmentX/apratment2.

IF that's possible that's gonne be greate to have some brrainiac touch to help a bit with starting using KRPANO, i just downloaded all those tools, but wanted to be independend of them, also would be nice to have this "chunking machine able to use via server side" but can stay with cubemap as well, chunks aren't neccessary at the moment.

And second small question - can we use KRPano funcionality for example switching spheres, fullscreen, minimap, hotspots etc. from outside the XML? lets say i want to create UI on the top of it, displaying both, but this UI will controll tour and krpano behavior

Thanks in advnace, hope this huge thing can handle everything, because VR/Gyroscope, smoothness etc. is pretty damn good, worh to switch from other tehcnologies even its XML

This post has been edited 1 times, last edit by "Kowalus23" (Dec 22nd 2021, 7:55am)


2

Wednesday, December 22nd 2021, 10:21pm

To be more percise i want to reach few things by using KRPANO if its possible, please let me know, i read documentation few forum posts and 80% is doable, but wanted to be sure if we can handle everything, doest matter if i have to spend extra money for everpano or cms4vr

Currently with A-frame i've done something liek this:
https://tours.3destate.pl/3d-estate---pr…iem-stylow/1.3d
2 floors version:
https://tours.3destate.pl/mieszkania-dwupoziomowe/aa0301.3d

Its fine, loading takes a bit, and it loading every single sphere that we have. We could change flow to stay with loading only first cubempa or first and clostest one, but then we decide to look for something better, faster, lighter and with great VR/Gyroscope support which A-frame had and have for some of the devices, especially iOS.

So i would like to create by using KRPANO, pretty same app, lets say by steps:

1. Custom UI on the top of the app with CSS, but pure JS with XML could work as well if it can happend.
- keep KRPANO funcionality, like autorotate, change sphere by clicking hotspot, switch floors before you went upstairs/downstairs with some animation
- most important is to have an option to change STYLE, which suppose to change whole XML sccene for cubemaps, could work with some variable that says, currentStyle = 'Paris', and some condition in XML to display if.... paris then show <scene> or whatever it is, or different better way to keep in one tour, for example 20 cubemaps + 5 styles, which means even 100 cubemaps, corner order we had with huge house and 52 cubemaps which for current technology was pretty heave to download them at initial load.

2. Dynamic load based on fetching data, opening URL, that prepare simple data to create tour and requesting for correct XML to put it into the loader, once you change url, or trigger some function that will reload whole XML with different dynamically fetched XML. Or any other better idea to handle this.

3. If i'll add plugin for example screenshot one, or radar or other, do we have always access to funcionality by javascript? or its not that easy as i thought it is?

4. I have one case that THE SAME tour can start in two different cubemaps, for example if the url is extended by the parameter ?isExterior=true, it suppose to start on the balcone and watch correct direction (outside the building), if there is no such a parameter, then load the tour in living room

5. is it possible to make an automation of creating XML by passing correct data with (hotspot) position, so for example from unreal or different machine we'll have some position x/y/z and use it to set proper position for an arrow or different kind of hotspot built in KRPANO. <-- is it possible to spawn it dynamically with those parameters.

6. Still thinking to do that at one GET request when we get into the app, GET configuration => XML for KRPANO that includes viewer (scene) + hotspots + radar, then load and show GUIDE + whole UI added on the top in Javascript with full connection to krpano functionality of all available features. *cool*

3

Thursday, December 23rd 2021, 12:50pm

Hi,

you could use krpano also without any xml at all.

The xml itself is just a 'transport-format', all that's defined there can be also defined dynamically.
It's a bit similar to html - there you can also define the elements either in the html or also create them all dynamically via JS.

E.g. start this way:

Source code

1
2
3
4
5
6
7
<script>
embedpano({xml:null, target:"id-of-a-div", onready:function(krpano)
{
  krpano = krpano.get("global");
  ...   
}});
</script>

With that krpano object you have you access to everything, to all variables, objects and functions.

Have a look at the code from these examples here, they are mainly scripted by javascript:
https://krpano.com/examples/?js

There the Javascript code is in the xml files, but it could be also the same way in the html file or anywhere else.

And with the new version 1.20.11 loading panos image by pure Javascript is even easier now,
e.g. to load sphere image:

Source code

1
2
3
krpano.image.reset();
krpano.image.sphere = {url:"pano.jpg"};
krpano.image.loadpanoimage();


to load and blend to another pano:

Source code

1
krpano.image.loadpanoimage('MERGE','BLEND(1.0)');


Adding hotspots:

Source code

1
2
3
4
5
var spot = krpano.addhotspot();
spot.url = "image.jpg";
spot.ath = 123;
spot.atv = 12;
spot.onclick = function(){ ... }


Getting event callbacks:

Source code

1
2
3
4
krpano.events.onloadcomplete = function()
{
  ...
}


About the UI - you can either do all with HTML+CSS or use the krpano layers or mix both, that's fully up to you. But using the layers can have some advantages, especially when it comes to touch controls and using different devices. Same about the krpano actions - you can either use them or do all by JS or mix them. Some things e.g. like making a layer or hotspot dragable can be much easier by using some action code then doing that manually in JS.

For more please have a look also at these pages:
https://krpano.com/docu/js/#directaccess
https://krpano.com/docu/plugininterface/#top

and for details about each element also here:
https://krpano.com/docu/xml/#top
https://krpano.com/docu/actions/#top

Best regards,
Klaus