Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Get Object size

codemastermike
Registered User
Quote
2011-10-06 09:17:42

Is there a way to get the world size of a object, both a Overlay2DSceneNode (width and height) object and a 3D object (x, y, z)?

You can set the width and height for a Overlay2DSceneNode object, but you cant get it from the object.


niko
Moderator
Quote
2011-10-06 15:01:40

You get the size of any object in 3D by querying it's bounding box. Use getBoundingBox() of any scene node, or getTransformedBoundingBox() if you prefer the bounding box in global space.

For the Overlay 2D node: You can use the not-documented function getScreenCoordinatesRect() for this, it takes a bool and the renderer as parameter. Use it for example like this: getScreenCoordinatesRect(false, engine.getRenderer());


codemastermike
Registered User
Quote
2011-10-07 12:08:25

Nice, thanks niko!


fabri
Registered User
Quote
2012-08-25 18:15:36

Hi,

I'm trying to create a simple demo where with 4 buttons (2D Overlay ditto) up, down, left, right respectively can go forward, backward, turn left, turn right.

I saw the 2D Overlay idem but I can not understand what actions should I use.

Who can help me?

Thank you very much


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inte?national" (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