Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
CopperLicht Tutorial: 2D Overlays?

s1mon
Registered User
Quote
2013-03-06 07:39:48

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();


niko
Moderator
Quote
2013-03-06 08:07:17

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.


s1mon
Registered User
Quote
2013-03-06 08:14:15

how to add one more "the origin"?
that also spun it's
Very important to me.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact