POV-Ray : Newsgroups : povray.newusers : First-time user - object groups : First-time user - object groups Server Time
5 Nov 2024 01:24:14 EST (-0500)
  First-time user - object groups  
From: me
Date: 23 Mar 2001 10:20:05
Message: <3abb69a5$1@news.povray.org>
I'm a first-time user of POV-Ray, and am really enjoying it. I am having a
bit of a problem, though, manipulating items made up of objects. Here's the
brief story: I have a podium that I have defined in POV-Ray, using three
boxes, eight rods (skinny cylinders) and a conical-sweep prism (basically an
upside-down pyramid with the top chopped off) that is scaled to be longer in
the y-axis. (I can send a .bmp if you wish.) Each of these objects I have
declared and named, as in this example:

#declare TopBox =
box
{
  <0, 0, 0>
  <14, 2.5, 14>
  pigment { color Wheat }
  translate <-7, 0, -3.5>
}
#declare BottomBox =
box
{
  <0, 0, 0>
  <12,  .5,  12>
  pigment { color Wheat }
  translate <-6, -17.5, -2.5>
}
#declare Base =
box
{
  <0, 0, 0>
  <12, .5,  12>
  pigment { color DarkWood }
  translate <-6, -19, -2.5>
}
#declare Main =
  prism {
    conic_sweep
    linear_spline
    0.825, // height 1
    1, // height 2
    5, // the number of points making up the shape...
    <5, 5>,<-5, 5>,<-5, -5>,<5, -5>,<5, 5>
    scale <1, 95, 1.2>
  texture {
    T_Wood3
  }
  translate <0, -97, 3.45>
}

The "rods" are declared in much the same way. My problem is this: I want to
use a #declare statement to combine each of these objects into one, as so:

#declare Podium_All =
object { Main }
object { FrontName }
object { FrontLogo }
object { TopBox }
object { BottomBox }
object { Base }
object { Rods }

and I want to be able to use an object {...} statement to move the construct
as one unit, as so:

object { Podium_All
   translate <0, 3, 0>
   rotate -45*y
 }

However, when I do this, only one piece of the whole object moves. Is there
something I'm missing? Is there some kind of ability to "nest" objects (or
in this case, sub-objects) into one object statement, so that POV-Ray sees
the individual pieces as one object? I'd appreciate any help.

dan


Post a reply to this message

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