I joined tonight to ask if it would be possible to generate XML files for the like of Immervision etc. only to find the new Beta with all the required features already built in!! You must have been listening
I have already created a basic Immervision "panorama.xml" file with just a little exploring to find out your internal variable names, it couldn't have been simpler.
Nice to hear.
As ever you just complete one addition and your customers come back asking for more of course
So with that in mind;
Any chance of a list of all the variable names we can use in generating the files ? It took a little while to pickup on the "360-config.viewingparameter." as opposed to "config.viewingparameter." ones
I tried to write up some stuff in http://gardengnomesoftware.com/wiki/HTML_Template
but the variable names follow the same pattern as the .p2vr project file so if you want to use a value just look it up in the project file like pan - min is stored in:
Code: Select all
so the corresponding variable is config.viewingparameter.pan.value("min")
where the last part is to get the actual value. There is also config.viewingparameter.pan.minimum()
but for the moment those names are not documented (min can't be used in this case because it's a reserved name). The first method is the saver one and should work in all cases and you can find out the name very easy. The same method works with the output
object for the current output format. The 360-config.viewingparameter.
from your example means 360.0 - config.viewingparameter.
so its basically inverting the direction of the pan angle to meet the need for SPi-V.
Also any chance of being able to output more than a single file ? For Immervision it would be nice to generate not only the .XML but also the .HTML simultaneously.
Yes! If you look into the SPi-V template you can see that a second file is created. You can do this with document.createfile(string dst, string content)
or document.createutf8file(string dst, string content)
depending on the encoding needed.
I assume by the way that the fov parameter is the Horizontal FoV, I ask because Immervision use Diagonal FoV which means some calculations / fudging to get an equivalent value
No, it's the vertical FoV but SPi-V uses the horizontal FoV so you can find this code also in the SPi-V template. For the diagonal FoV the code should look like this:
Code: Select all
dfov=2*Math.atan(Math.sqrt(formvalue["width"]*formvalue["width"] + formvalue["height"]*formvalue["height"])/formvalue["height"] * (Math.tan((output.fov() / 2)*Math.PI/180)))*180/Math.PI;