So, I am trying to take a different approach of adding text into the viewer by using HTML. My current approach is that I append the elements to the viewer container, but the problem with that is that the position is absolute. It always sticks to the screen/canvas, so when I move around in the scene, it does not move with it. What I want is for the element to be stuck to the scene, so when the camera moves, it moves along with the scene because it is stuck to it. I have tried the following:
this.viewer.addEventListener(Autodesk.Viewing.GEOMETRY_LOADED_EVENT, function(event){
console.log(event.target);
event.target.impl.createOverlayScene('test');
event.target.impl.addOverlay('test');
var node = document.createElement("LI"); // Create a <li> node
var textnode = document.createTextNode("Water"); // Create a text node
node.appendChild(textnode);
// Append the text to <li>
event.target.clientContainer.appendChild(node)
});
I have messed around with overlay scenes, but it seems they are only for WebGL. So, what is the correct way to add elements to the viewer that share the same scale, and will move around with the camera like the element is part of the scene?