|
![](/i/fill.gif) |
In article <4033d465$1@news.povray.org>,
"Dan P" <dan### [at] yahoo com> wrote:
> object ColoredSphere (v, c) inherits Sphere
> {
> pigment
> {
> color = c
> }
> }
>
> object red_sphere = new ColoredSphere (<1, -2, 3>, new Color(1, 0, 0))
> object green_sphere = new ColoredSphere (<2, -2, 3>, new Color(0, 1, 0))
Ugh...don't blindly copy other langauges without understanding why they
do the things they do. Your "new" statements are completely useless,
they do nothing. Anyway, my idea of the syntax would be more like this:
def ColoredSphere: derive sphere {
ColoredSphere(cent, rad, col) {
sphere {cent, rad pigment {col}}
}
}
def RedSphere: ColoredSphere {< 1,-2, 3>, 1, color < 1, 0, 0>}
ColoredSphere {< 1,-2, 3>, 1, color < 1, 0, 0>}
--
Christopher James Huff <cja### [at] earthlink net>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: <chr### [at] tag povray org>
http://tag.povray.org/
Post a reply to this message
|
![](/i/fill.gif) |