|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
#include "math.inc"
#macro dabox(p1,p2)
box{0, 1 texture {boxhm}
scale vlength(p2-p1)
rotate vcross(1,p2)*VRotationD(1, p2, vcross(1,p2))
translate p1
}
#end
With textures:
#include "colors.inc"
#include "metals.inc"
#include "woods.inc"
#include "math.inc"
#declare box_holz = texture {T_Wood10 scale 1 rotate y*20 };
#declare box_metal = texture {T_Silver_3D};
#declare box_metal_ab = 0.85;
#declare boxhm =
texture {
function{sqrt(y*y+(1-z)*(1-z))}
texture_map {
[ 0.0 box_holz ]
[ box_metal_ab box_holz ]
[ box_metal_ab*1.0107 box_metal ]
[ 1 box_metal ]
}
};
#macro dabox(p1,p2)
box{0, 1 texture {boxhm}
scale vlength(p2-p1)
rotate vcross(p1,p2)*VRotationD(p1, p2, vcross(p1,p2))
translate p1
}
#end
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Oh! Didn't want to start a new thread.
And the first line got lost:
"Well my first try by myself: but it doesn't work.
"
:)
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
I have chosen another way to solve this:
#macro dabox(bd,yrot,p1)
// bd: <width,height,deepnes>; yrot: -> orientation; p1: box-corner
bottom left
box{0, 1 texture {boxhm}
scale bd
rotate y*yrot
translate p1
}
#end
Greetings
Dieter
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Not sure if this answers the question but if you declare the box to be an
object, you can then rotate that object to the desired orientation.
Hope this helps.
"D. H. Berlin" <wee### [at] PoVStefaniede> wrote:
> I have chosen another way to solve this:
>
> #macro dabox(bd,yrot,p1)
> // bd: <width,height,deepnes>; yrot: -> orientation; p1: box-corner
> bottom left
> box{0, 1 texture {boxhm}
> scale bd
> rotate y*yrot
> translate p1
> }
> #end
>
> Greetings
> Dieter
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"incognito" <nomail@nomail> wrote:
> Not sure if this answers the question but if you declare the box to be an
> object, you can then rotate that object to the desired orientation.
>
> Hope this helps.
I figured out that it is important always to use the same scheme for the
coordinates p1 and p2: for example p1 always front bottom left corner and
p2 backward upper right corner
Then I could just the way I'm doing it now. (Instead of using mathematics I
don't understand. :)
Greetings
Dieter
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|