get_img_object.php
shows usage of get scene object
by veeuze
HTML
<script src="https://integrate.materialo.com/v2.0/js/vendor/XMLDisplay.js"></script>
<link rel="stylesheet" href="https://integrate.materialo.com/v2.0/css/vendor/XMLDisplay.css">
<div id="scriptname"></div>
<div id="output"></div>
CSS
body {
white-space: pre;
font-family: monospace;
}
#scriptname,
#output {
background-color: #fff;
padding: 10px;
}
img{
/* this is to highlight the mappable area - in this case in red */
background-color: #f00;
}
iframe {
width: 100%;
height: 500px;
border: none;
}
JavaScript
// Please adjust the following variables to your liking:
var cnf = "integrate-demo";
var oid = "198462";
var view = "0";
var w = "512";
var h = "380";
var dbg = "0";
// end of adjustment
var scriptname = "https://integrate.materialo.com/v2.1/get_img_object.php?cnf=" + cnf + "&oid=" + oid + "&view=" + view + "&w=" + w + "&h=" + h + "&dbg=" + dbg;
var scriptname_display = "https://integrate.materialo.com/{VersionCode}/get_img_object.php?cnf=" + cnf + "&oid=" + oid + "&view=" + view + "&w=" + w + "&h=" + h + "&dbg=" + dbg;
$('#scriptname').html("This is the script you are calling:\r\n" + scriptname_display);
if (dbg == 1) {
$("#output").html("<iframe src='" + scriptname_display + "'></iframe>");
} else {
$('#output').html(
"This is the output:\r\n<img src='" + scriptname + "' />");
}