Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Feature requests and bug reports
XML Parsing Error

ddabrahim
Registered User
Quote
2017-12-27 15:07:05

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:



just_in_case
Moderator
Quote
2017-12-28 17:56:20

Did you get any error in the debug window...
I never experienced such errors...

Maybe you need to do something with your if satement..



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);


Try this code...


ddabrahim
Registered User
Quote
2017-12-28 19:04:15

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.


just_in_case
Moderator
Quote
2017-12-29 04:22:11

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....??


ddabrahim
Registered User
Quote
2017-12-29 11:08:06

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.


Create reply:


Posted by: (you are not logged in)


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