|
|
"MessyBlob" <nomail@nomail> wrote:
> I'm not sure about assigning 'new objects as properties' within these
> properties, e.g. creating a new material in the Sphere new object. Can anyone
> clarify this?
Just realised:
Sph = new Sphere( {
radius: 1,
position: [0,0,1],
material: new Material( { ... } )
} );
And if you wanted to re-use an object, a simple reference would do:
myMaterial = new Material( { ... } );
Sph = new Sphere( {
radius: 1,
position: [0,0,1],
material: myMaterial
} );
Post a reply to this message
|
|