xeolabs/scenejs — Issue #144: Can' i update Layers priority Dynamicaly ?
Author: hwilliam
Created: 2011-11-02 10:25:25+00:00
State: open

hello,

I have in my scene some transparent items, these items are animated and change the position ( draw order must be changed ) . I have embedded each item in a "layer" with a "priority" reflecting the logical draw order. For each loop, I update the priority (the order) according the animation.
The result seems to be wrong at screen and seems to have no effect …

Here is my main update scene funcion

this.sjsScene.findNode(item.mat_name+'_layer').set('priority', 1+this.GetRelativeSlot(a));// draw order from 1+’0 to N’)
this.sjsScene.findNode(item.quat_name).set("quaternion", key.quat);
this.sjsScene.findNode(item.trans_name).set('xyz', key.trans);
this.sjsScene.findNode(item.scale_name).set('XYZ', key.scale);
this.sjsScene.findNode(item.mat_name).set('alpha', key.alpha);

I can observe that the “set('priority'” has an effect because items are flashing / lighing)

Is it the correct way to do this ?
Advices will be welcome ..

Regards