Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperLicht
Animator and custom scene node

alext
Registered User
Quote
2012-06-15 16:09:02

When I add custom scene node as you showed in tutorial03 the CL3D.Animator On Click is not working for this node.
var mynode = new MySceneNode(engine);
(...)
mynode.addAnimator(animator);

However if I create cube object CL3D.CubeSceneNode CL3D.Animator On Click works for a cube. Is that a way to use this type of the animator for objects created like you showed in the tutorial?


erik
Registered User
Quote
2012-06-16 07:08:55

For me, animators work with my own custom scene nodes. Are you sure you derived it from SceneNode, using
MySceneNode.prototype = new CL3D.SceneNode();

?


alext
Registered User
Quote
2012-06-16 08:07:22

Look here:

http://www.pinerly.com/deck/3d

and make a source view. I did like that (I had to):

var cubenode = new CL3D.CubeSceneNode();
var animator_cl = new CL3D.Animator(engine.getScene(), engine, SlideLeft);
cubenode.addAnimator(animator_cl);
cubenode.getMaterial(0).Type = CL3D.Material.EMT_TRANSPARENT_ALPHA_CHANNEL;
cubenode.getMaterial(0).Tex1 = engine.getTextureManager().getTexture('textures/trans.png', true);
cubenode.Pos.X = 15; cubenode.Pos.Y = 2; cubenode.Pos.Z = 98;
cubenode.Scale.Y = 0.5;
scene.getRootSceneNode().addChild(cubenode);


So I am encompasing the arrows you can click at the end of the corridor with transparent (but visible) cube. Very poor method. I dont just understand why :
arrow_left.addAnimator(animator_cl);

doesnt work?


erik
Registered User
Quote
2012-06-16 10:26:09

I think the CL3D.Animator doesn't do anything by default. You need to use one of the specializations, depending on what you want to do. Like
var animator_cl = new CL3D.AnimatorRotation(new CL3D.Vect3d(1,0,0));



alext
Registered User
Quote
2012-06-16 13:25:33

If I get rid of the cube and replace the code;

var animator_cl = new CL3D.Animator On Click(engine.getScene(), engine, SlideLeft);
cubenode.addAnimator(animator_cl);

with
var animator_cl = new CL3D.Animator On Click(engine.getScene(), engine, SlideLeft);
arrow_left.addAnimator(animator_cl);

it doesnt work :)

also I dont also know why I cannot write normally CL3D.Animator On Click on that forum because its being replaced by CL3D.Animator causing misunderstang :) LOL


niko
Moderator
Quote
2012-06-16 14:04:54

Yes, sorry about the problem with the forum, we once had some lame forum hijacking attempts and the forum now is a bit paranoid :)
Probably this might help you with your problem, there are some things you need to do in order to make on-click animators work with your own scene node:
http://www.ambiera.com/forum.php...


alext
Registered User
Quote
2012-06-16 14:54:18

thanks niko :) this helps.


Create reply:


Posted by: (you are not logged in)


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