ambiera logo

Ambiera Forum

Discussions, Help and Support.

folder icon Ambiera Forum > CopperLicht
forum topic indicator ClickAnimator not working in tutorial 3
person icon
bagg
Registered User
Quote
2010-10-12 09:32:55

Hi niko.

Can you please explain to me why the Animator is not working on the custom mesh in tutorial 3 ? What i mean is that if you add to the code

ClickAnimator = new Animator(engine.getScene(), engine, SelectFunction);
mynode.addAnimator(ClickAnimator);

and the SelectFunction is just an alert nothing happens when you click the mesh.

Thanks.

person icon
erik
Registered User
Quote
2010-10-12 10:53:37

See here: http://www.ambiera.com/forum.php...
You maybe need a bounding box for your object.

person icon
bagg
Registered User
Quote
2010-10-12 17:57:40

Sorry didn't got it.Can you give me the example code of tutorial 3 modified and instead of rotation animator to add on click animator?

Thanks.

person icon
niko
Moderator
Quote
2010-10-13 08:06:40

in the end of the function "MySceneNode = function(engine)" add something like

buf.recalculateBoundingBox();
this.MyBox = buf.Box;

and at the end of the script, add something like

MySceneNode.prototype.getBoundingBox = function()
{
return this.MyBox;
}


person icon
bagg
Registered User
Quote
2010-10-13 08:30:56

Thanks man that did it.But now i have another question.
What if we have more than one meshbuffer?How we update the parent's bounding box?

person icon
niko
Moderator
Quote
2010-10-14 18:28:48

The mesh containing all buffers also has a bounding box. You can simply calculate its box as well (look at the documentation for the bounding box members, there are some functions to add boxes to one box, so you don't need to write not much code for it)

person icon
bagg
Registered User
Quote
2010-10-14 20:17:11

I didn't found any function in the documentation for adding a bounding box to another or how to calculate the bounding box that contains the mesh buffers maybe you can point me on this please?

and another thing.In the tutorial 3 if we add:
var CheckSceneNode = engine.getScene().getAllSceneNodesOfType('mesh');
for (var j = 0; j < CheckSceneNode.length; j++)
{
if (CheckSceneNode)
{
alert ("OK");
}
}
It's not working which it means that it doesn't get the created mesh.
Why?

Thanks for your quick support.


Create reply:










 

  

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


icon_holyicon_cryicon_devilicon_lookicon_grinicon_kissicon_monkeyicon_hmpf
icon_sadicon_happyicon_smileicon_uhicon_blink   






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