POV-Ray : Newsgroups : povray.newusers : normals and pigments in a csg Server Time
6 Sep 2024 02:19:55 EDT (-0400)
  normals and pigments in a csg (Message 11 to 12 of 12)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Chris Colefax
Subject: Re: normals and pigments in a csg
Date: 20 Jul 1999 20:26:41
Message: <379513c1@news.povray.org>
Daniel Pirch wrote:
> But if the objects are part of other transplated CSGs?
>
> #declare spheres = union{
>   sphere{ -2*x, 1 pigment{ rgb<1,0,0>}}
>   sphere{0, 1 pigment{rgb <0,1,0>}}
>   sphere{ 2*x,1 pigment{ rgb<0,0,1>}}
> }
> union{
>   object{spheres translate 2*z}
>   object{spheres}
>   object{spheres translate -2*z}
>   normal{Norm}
> }

What you wish to do is not possible because specifying a
pigment/normal/finish for an object is actually shorthand for specifying an
entire texture.  In the examples you give above, the pigment statements
apply the default texture to each sphere, with the pigment changed as
desired.  Similarly, the normal applied to the union is shorthand for the
default texture with a changed normal.  CSG textures are only applied to
those child objects that don't have textures specified - and all the spheres
now do, thanks to the pigments.

One possible solution is to predeclare the normal, and apply it to each
object with the pigment.  Or, you can take advantage of the default texture
I mentioned above, by specifying the changed normal *before* declaring the
spheres, eg:

   default {normal {bumps .5}}

This saves typing because you don't need to add it to each object.
Unfortunately, neither method will allow you to transform copies of the
declared object without transforming the texture.  For this, you need to
transform the object, and then apply the texture - perhaps you could use a
macro that creates and places the objects prior to texturing?


Post a reply to this message

From: Peter Popov
Subject: Re: normals and pigments in a csg
Date: 21 Jul 1999 04:09:38
Message: <37957f57.54302713@204.213.191.228>
Have you tried using the #default directive?


Peter Popov
ICQ: 15002700


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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