load the model, the container turns black.
at first thought it was my program"s problem. But try it with the code of the example, too.
is there something wrong with the server?
the following is the source code of the example. It used to be possible. Not anymore.
< html >
< head >
<meta charset="UTF-8">
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/three.min.css"></script>
<link rel="stylesheet" href="https://developer.api.autodesk.com/viewingservice/v1/viewers/style.min.css" />
<script src="https://developer.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
< / head >
< body onload= "initialize ()" >
< div id= "viewer" style= "position:absolute; width:90%; height:90%;" > < / div >
< script >
function authMe () { return ("eyJhbGciOiJIUzI1NiIsImtpZCI6Imp3dF9zeW1tZXRyaWNfa2V5In0.eyJjbGllbnRfaWQiOiJIalFGcGpyU0JIM3EyMkJETVZGUGdZYjdzVkFZRmFiSiIsImV4cCI6MTUyMDI1OTMzNywic2NvcGUiOlsiZGF0YTpyZWFkIiwiZGF0YTp3cml0ZSIsImJ1Y2tldDpjcmVhdGUiLCJidWNrZXQ6cmVhZCJdLCJhdWQiOiJodHRwczovL2F1dG9kZXNrLmNvbS9hdWQvand0ZXhwNjAiLCJqdGkiOiJhc294RjJQU3Q3VGVORkh1TXVDWWV3b052cnFpRWU5VjREbkxCZUhFeVZDcnJSWnZ3V1FwbW83M0tDYzM1NzBEIn0.0mkXxMhJ-JRYjD7qjLcM3IOinShEV-kqLJMzQhvDVzA") ; }
function initialize () {
var options ={
"document" : "urn:dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6Zm9yZ2UtY3NoYXJwLXNhbXBsZS1hcHAtaGpxZnBqcnNiaDNxMjJiZG12ZnBneWI3c3ZheWZhYmovbXktZWxlcGhhbnQub2Jq",
"env": "AutodeskProduction",
"getAccessToken": authMe
} ;
var viewerElement =document.getElementById ("viewer") ;
//var viewer =new Autodesk.Viewing.Viewer3D (viewerElement, {}) ; / No toolbar
var viewer =new Autodesk.Viewing.Private.GuiViewer3D (viewerElement, {}) ; // With toolbar
Autodesk.Viewing.Initializer (options, function () {
viewer.initialize () ;
loadDocument (viewer, options.document) ;
}) ;
}
function loadDocument (viewer, documentId) {
// Find the first 3d geometry and load that.
Autodesk.Viewing.Document.load (
documentId,
function (doc) { // onLoadCallback
var geometryItems =[] ;
geometryItems =Autodesk.Viewing.Document.getSubItemsWithProperties (
doc.getRootItem (),
{ "type" : "geometry", "role" : "3d" },
true
) ;
if ( geometryItems.length <= 0 ) {
geometryItems =Autodesk.Viewing.Document.getSubItemsWithProperties (
doc.getRootItem (),
{ "type": "geometry", "role": "2d" },
true
) ;
}
if ( geometryItems.length > 0 )
viewer.load (
doc.getViewablePath (geometryItems [0])//,
//null, null, null,
//doc.acmSessionId /*session for DM*/
) ;
},
function (errorMsg) { // onErrorCallback
alert("Load Error: " + errorMsg) ;
}//,
//{
// "oauth2AccessToken": authMe (),
// "x-ads-acm-namespace": "WIPDM",
// "x-ads-acm-check-groups": "true",
//}
) ;
}
< / script >
< / body >
< / html >