Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Not sure if it a bug. I'm trying to rotate the direction of the directional light using this code: var speed = 0.01; var sun = ccbGetSceneNodeFromName("sun"); var direction = ccbGetSceneNodeProperty(sun, "Direction"); if(direction.x <= 1.0) {direction.x += speed} if(direction.x > 1.0) {direction.x = -0.2} ccbSetSceneNodeProperty(sun, "Direction", direction.x, direction.y, direction.z); It works on windows, but I get this error message in WebGL XML Parsing Error: syntax error Location: http://.....AppData/Local/Temp/copperlichtdata/coppercube.ccbjs Line Number 1, Column 1:
|
||||
|
Did you get any error in the debug window... I never experienced such errors... Maybe you need to do something with your if satement..
Try this code... |
||||
|
Thanks for the reply. I get the same error with your code too. On Windows the debug window show no error but it also works on Windows, in WebGL I don't know how to display the debug window but I think the console should display any error might have and the XML Parsing Error the only one I got. Probably it got something to do with the way I organize my code, but I think it should work anyway since it works on Windows. Thanks. |
||||
|
i tried out the code.... i am not getting any error with this.. instead am getting a complete black screen .... when the script get executed.... i tried it on Firefox.. which browser are you using....?? |
||||
|
Actually, the XML parsing error I'm getting is unrelated to the code. Sorry, I did not pay attention it coming from somewhere else even if I don't have the code in the game. Do you mean it dark? Because it is dark but the directional light should be rotating. The code does not seem to return any error but it still doesn't work in WebGL for whatever reason. But probably it is unrelated to the XML Parsing Error or maybe not, I can't tell. A side note, I tried rotating the light similar way using Copperlicht and it returned the light in the scene is not directional but it is.... maybe that is why the code doesn't work and maybe it is related somehow to the XML parsing error but I'm just tired of trying something so basic get to work for days. I guess I try something else now. Thanks for your help. |
|