Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
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. |
||||
|
See here: http://www.ambiera.com/forum.php... You maybe need a bounding box for your object. |
||||
|
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. |
||||
|
in the end of the function "MySceneNode = function(engine)" add something like
and at the end of the script, add something like
|
||||
|
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? |
||||
|
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) |
||||
|
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. |
|