|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
is there a way to make some boxes with a simple loop, but each box must have
one surface that is a bit rotated realative to the box. I thougt of making
a box and then substract another box from it. The other box needs a random
rotation (a few degrees) for each box made in the loop.
difference{
box ( <0,-1,-1> <2,1,1> )
box ( <1,-2,-2> <2,2,2> rotate z*...) //this box needs a random rotation
}
I don't know if u understand, but what i'm trying to do is get rid of all
those straight & rectangular shapes in my scene (a western barn). i need
randomness & dirt!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Lenx <lenx_@hotmail.com> wrote:
> difference{
> box ( <0,-1,-1> <2,1,1> )
> box ( <1,-2,-2> <2,2,2> rotate z*...) //this box needs a random rotation
> }
Declare a rand stream like this:
#declare S = seed(0); // or whatever value you wish
Then you can use the rand() function to get random values. For example
if you want to rotate randomly between -20 and 20 degrees, you can do it
like this:
rotate z*(-20+40*rand(S))
If you create the boxes inside a #while-loop, each one will have a different
rotation.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Warp wrote:
>Lenx <lenx_[at]hotmail.com> wrote:
>> difference{
>> box ( <0,-1,-1> <2,1,1> )
>> box ( <1,-2,-2> <2,2,2> rotate z*...) //this box needs a random rotation
>> }
>
> Declare a rand stream like this:
>
>#declare S = seed(0); // or whatever value you wish
>
> Then you can use the rand() function to get random values. For example
>if you want to rotate randomly between -20 and 20 degrees, you can do it
>like this:
>
> rotate z*(-20+40*rand(S))
>
> If you create the boxes inside a #while-loop, each one will have a different
>rotation.
>
>#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
>N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
>N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
>
thx for your help. and i guess i'd better substract a plane rather then a
box.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|