Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
I can not connect the new 2d overlay? The lesson is "The origin" How do I add a lot of these overlays as "The origin"? I understand it is necessary to add here? // move 2d overlay to this 3d position every frame var pos3d = new CL3D.Vect3d(0,0,0); engine.OnAnimate = function() { var element = document.getElementById('originlabel'); if (element) { // set the position of the label to the 2d position of the 3d point var pos2d = engine.get2DPositionFrom3DPosition(pos3d); var hide = false; if (pos2d) { element.style.left = pos2d.X; element.style.top = pos2d.Y; // hide if outside of the border hide = pos2d.X < 0 || pos2d.Y < 0 || pos2d.X > engine.getRenderer().getWidth()-60 || pos2d.Y > engine.getRenderer().getHeight()-20; } else hide = true; element.style.display = hide ? 'none' : 'block'; } } } main(); |
||||
|
Not exactly sure what your problem is. It works like this: in that example, the HTML 2d overlays should be at the position of a 3d position. That's why the 2d position is set manually there. |
||||
|
how to add one more "the origin"? that also spun it's Very important to me. |
|