POV-Ray : Newsgroups : povray.general : Difference or RAND Problem: Help Needed Server Time
1 Aug 2024 04:10:35 EDT (-0400)
  Difference or RAND Problem: Help Needed (Message 1 to 3 of 3)  
From: Sven Littkowski
Subject: Difference or RAND Problem: Help Needed
Date: 30 Apr 2006 13:29:26
Message: <4454f3f6$1@news.povray.org>
Greetings.

I have the following code which should create a number of cylindrical towers 
with a rounded roof (cylinder and sphere). But it seems the code is not 
working. Who can help?

Thanks,

Sven

#declare BayTowers=difference
{
  #declare Turn=0;
  #declare Diameter=seed(1);
  #declare Tall=seed(2);
  #declare Wide=seed(3);
  #declare Deep=seed(4);
  #while(Turn<200)
   cylinder
   {
     < 0.0, 0.0, 0.0 > < 0.0, 30*rand(Tall), 0.0 > 100.0*rand(Diameter)
     translate < 0.0, -330.0, 0.0 >
     texture { Licht }
     texture {InnenAufbaut }
     translate < -100.0+(200*rand(Wide)), 0.0, 0.0+(1600*rand(Deep)) >
   }
   sphere
   {
     < 0.0, 0.0, 0.0 > 100.0*rand(Diameter)
     scale < 1.0, 0.3, 1.0 >
     translate < 0.0, -330.0-(30*rand(Tall)), 0.0 >
     texture { InnenOben }
     translate < -100.0+(200*rand(Wide)), 0.0, 0.0+(1600*rand(Deep)) >
   }
   cylinder
   {
     < 0.0, 0.0, 0.0 > < 0.0, 30*rand(Tall), 0.0 > 100.0*rand(Diameter)
     translate < 0.0, -330.0, 0.0 >
     texture { Licht }
     texture {InnenAufbaut }
     translate < -100.0+(200*rand(Wide)), 0.0, 0.0+(1600*rand(Deep)) >
     scale < 1.0, -1.0, 1.0 >
   }
   sphere
   {
     < 0.0, 0.0, 0.0 > 100.0*rand(Diameter) scale < 1.0, 0.3, 1.0 >
     translate < 0.0, -330.0-(30*rand(Tall)), 0.0 >
     texture { InnenOben }
     translate < -100.0+(200*rand(Wide)), -0.0, 0.0+(1600*rand(Deep)) >
     scale < 1.0, -1.0, 1.0 >
   }
   #declare Turn=Turn+1;
  #end
 }
 difference
 {
  cylinder { < 0.0, 0.0, -200.0 > < 0.0, 0.0, 1800.0 > 500.0 texture { 
Licht } texture { Innen } }
  cylinder { < 0.0, 0.0, -200.01 > < 0.0, 0.0, 1800.01 > 330.0 texture { 
Licht } texture { Innen } }
 }
}


Post a reply to this message

From: Mike Williams
Subject: Re: Difference or RAND Problem: Help Needed
Date: 30 Apr 2006 15:14:00
Message: <yHWf+IAxxQVEFwkP@econym.demon.co.uk>
Wasn't it Sven Littkowski who wrote:
>Greetings.
>
>I have the following code which should create a number of cylindrical towers 
>with a rounded roof (cylinder and sphere). But it seems the code is not 
>working. Who can help?

All the objects in a difference are removed from the first object. In
the BayTowers difference, that first object is a random cylinder. By the
time you've cut out 399 other random cylinders and 400 random spheres
from it, it's unlikely that there's be anything left of it.

The second, unnamed, difference works OK, except that there's an extra
"}" at the end.


Is it possible that you meant to difference that second object from the
*union* of the 400 cylinders and spheres?

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Sven Littkowski
Subject: Re: Difference or RAND Problem: Help Needed
Date: 30 Apr 2006 16:18:17
Message: <44551b89$1@news.povray.org>
Hi Mike,

thanks for your time and intentions! I solved the problem meanwhile. The 
thought was, to have a giant hollow tube (or pole) with many of these towers 
inside, cut by the walls of the giant tube.

So all what is supposed to be left of the towers, is what is inside the 
hollow tube. I had problems with the Intersection but I will try again.

You can see what it all is about in my next download, the "Preview 09: 
Imperial Carrier" (inside the "Preview 03: Imperial Carrier" thread). There 
you can already see in which "tubes" the towers are going to be...

Greetings and thanks again,

Sven


"Mike Williams" <nos### [at] econymdemoncouk> schrieb im Newsbeitrag 
news:yHWf+IAx### [at] econymdemoncouk...
> Wasn't it Sven Littkowski who wrote:
>>Greetings.
>>
>>I have the following code which should create a number of cylindrical 
>>towers
>>with a rounded roof (cylinder and sphere). But it seems the code is not
>>working. Who can help?
>
> All the objects in a difference are removed from the first object. In
> the BayTowers difference, that first object is a random cylinder. By the
> time you've cut out 399 other random cylinders and 400 random spheres
> from it, it's unlikely that there's be anything left of it.
>
> The second, unnamed, difference works OK, except that there's an extra
> "}" at the end.
>
>
> Is it possible that you meant to difference that second object from the
> *union* of the 400 cylinders and spheres?
>
> -- 
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

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