X3DOM Inline Background skyColor

934 views Asked by At

In my project, I use X3DOM to visualize x3d files ; all the x3d files made in Catia have black background :

<Background  skyColor="0.0 0.0 0.0 "/>

To load the x3d files, I use a simple inline tag and change the url then I'm doing something like :

$("x3d").attr("background", "white");

Everytime I load a x3d file using the inline url the background attribute will not work because it seems the background of the inline file has the priority.

I would like to know if there is a way to change the Background skyColor Attribute via the DOM.

EDIT :

I found a way, just add the tag <Background skyColor="1 1 1" /> in the x3d after the inline.

1

There are 1 answers

0
Daly Realism On

The canvas defined by the X3D tag is always overridden by the Background node (as you found out). It might make your operation easier if you put an ID on the Background node that you wish to change; otherwise the background color for all Background nodes might change.