POV-Ray : Newsgroups : povray.pov4.discussion.general : Next Generation SDL: What's wrong with Lua, JavaScript, ... : Re: Next Generation SDL: What's wrong with Lua, JavaScript, ... Server Time
16 Oct 2024 00:14:24 EDT (-0400)
  Re: Next Generation SDL: What's wrong with Lua, JavaScript, ...  
From: MessyBlob
Date: 11 Apr 2009 18:50:01
Message: <web.49e11d77e7a64ad8addfbead0@news.povray.org>
"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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.