POV-Ray : Newsgroups : povray.windows : Block colour not being rendered Server Time
28 Jul 2024 18:24:06 EDT (-0400)
  Block colour not being rendered (Message 1 to 6 of 6)  
From: Mark Hyde
Subject: Block colour not being rendered
Date: 18 Dec 1997 00:59:47
Message: <3498BBD0.F6C2DA24@northnet.com.au>
Hi  I am trying to render a scene of a child's room with some toya on
the floor and a bed in the corner.  Everything renders fine except for
two plastic blocks that have wheels on.  The wheels and the knobs on top
of the blocks come out as planned but the main part of the block  comes
out as being black.

The two blocks are identical except for colour, one is meant to be blue
with white wheels and the other is white with red wheels

The code related to the two blocks is below.  Please tell me what i've
done wrong.  I'm using Povwin3.02 if it helps.


#declare Bottom = box { <-4, 4, -5>
  <4, 6, -7>
  finish {
    ambient .3
    diffuse .6
  }
}

#declare Knob1 = cylinder { <-3, 6, -6.5>
  <-3, 7, -6.5> .5
}

#declare Knob2 = object { Knob1
   translate <2, 0, 0>
}

#declare Knob3 = object { Knob2
   translate <2, 0, 0>
}

#declare Knob4 = object { Knob3
   translate <2, 0, 0>
}

#declare Knob5 = object { Knob4
   translate <0, 0, 1>
}

#declare Knob6 = object { Knob5
   translate <-2, 0, 0>
}

#declare Knob7 = object { Knob6
   translate <-2, 0, 0>
}

#declare Knob8 = object { Knob7
   translate <-2, 0, 0>
}

#declare Wheel1 = cylinder { <-3, 4, -7.5>
  <-3, 4, -7> 1
 }

#declare Wheel2 = object { Wheel1
  translate <6, 0, 0>
}

#declare Block_1 = union {
  object {Knob1}
  object {Knob2}
  object {Knob3}
  object {Knob4}
  object {Knob5}
  object {Knob6}
  object {Knob7}
  object {Knob8}
  object {Bottom}
}

#declare Block_2 = object {Block_1
  translate <10, 0, 0>
}

#declare Tyres = union {
  object {Wheel1}
  object {Wheel2}
}

#declare Tyres_A = object {Tyres
  translate <10, 0, 0>
}

object {Block_1
  pigment {Blue}
}
object {Block_2
  pigment {White}
}
object {Tyres
  pigment {White}
}
object {Tyres_A
  pigment {Red}
}


Post a reply to this message

From: Ronald L  Parker
Subject: Re: Block colour not being rendered
Date: 18 Dec 1997 09:14:50
Message: <349a2e00.3408220@10.0.2.33>
On Thu, 18 Dec 1997 16:59:47 +1100, Mark Hyde <mlh### [at] northnetcomau>
wrote:

>Hi  I am trying to render a scene of a child's room with some toya on
>the floor and a bed in the corner.  Everything renders fine except for
>two plastic blocks that have wheels on.  The wheels and the knobs on top
>of the blocks come out as planned but the main part of the block  comes
>out as being black.
>
>#declare Bottom = box { <-4, 4, -5>
>  <4, 6, -7>
>  finish {
>    ambient .3
>    diffuse .6
>  }
>}
[ ... ]
>#declare Block_1 = union {
[ ... ]
>  object {Bottom}
>}
[ ... ]
>object {Block_1
>  pigment {Blue}
>}

It looks as though the texture on a union doesn't override any
textures specified for the components of the union.  I wasn't able to
find where this is mentioned in the documentation, if anywhere, but if
you move your finish statement from the declaration of Bottom to the
declaration of Block_1 (where it should probably be anyway) it works
just fine.


Post a reply to this message

From: George Hunt
Subject: Re: Block colour not being rendered
Date: 22 Dec 1997 23:12:03
Message: <349f3999.784816885@news.stmuc.com>
On Thu, 18 Dec 1997 14:14:50 GMT, ron### [at] farmworkscom (Ronald L. Parker)
wrote:

>
>It looks as though the texture on a union doesn't override any
>textures specified for the components of the union. 

That is correct.  The way I think about it is "The texture of a parent
(union CSG in this case) applies to any and all children (primitives
or other CSGs that make up the parent) unless that child has a texture
of its own specified."


-----------
George Hunt --- Raytracer Obsessivo
http://ourworld.compuserve.com/homepages/lightsword
102### [at] compuservecom
-----------


Post a reply to this message

From: Roland Mas
Subject: Re: Block colour not being rendered
Date: 20 Dec 1997 06:19:59
Message: <67g9kv$mg2$1@melchior.Cuivre.FR.EU.ORG>
Mark Hyde (mlh### [at] northnetcomau) wrote:
[...]
> #declare Bottom = box { <-4, 4, -5>
>   <4, 6, -7>
[...]
> }
Here is one error. _Each_ component of the first if the two vectors
defining the corners of the box should be less than the corresponding
one in the second vector. See what I mean?
box {
  <x1, y1, z1>, <x2, y2, z2>
}
where x1 < x2, y1 < y2, z1 < z2. Here:
#declare Bottom = box {
  <-4, 4, -7>, <4, 6, -5>
}

Let us know if this correction does not work.
  B-o-b
--

bob### [at] casimirrezelenstfr -- Linux, POV-Ray, LaTeX


Post a reply to this message

From: Nieminen Mika
Subject: Re: Block colour not being rendered
Date: 20 Dec 1970 15:21:38
Message: <349c28d2.0@news.povray.org>
Roland Mas (bob### [at] casimirrezelenstfr) wrote:
: Mark Hyde (mlh### [at] northnetcomau) wrote:
: [...]
: > #declare Bottom = box { <-4, 4, -5>
: >   <4, 6, -7>
: [...]
: > }
: Here is one error. _Each_ component of the first if the two vectors
: defining the corners of the box should be less than the corresponding
: one in the second vector. See what I mean?

  Why? I have never had any problem with that.

--
                                                              - Warp. -


Post a reply to this message

From: Alan Grainger
Subject: Re: Block colour not being rendered
Date: 21 Dec 1997 19:12:42
Message: <349dbe51.0@news.povray.org>
Yeah, it makes no difference.

--
Alan Grainger
Member of DNRC
E-mail - scythex*@geocities.com
Homepage - http://alansworld.home.ml.org
Remove * from e-mail address to reply


Post a reply to this message

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