|
![](/i/fill.gif) |
Hi,
That's not quite right! It over-rotates.
The following snippet is geometrically correct and illustrates the point.
#declare Chrome = texture { T_Chrome_3C }
#declare Gold = texture { T_Gold_1A}
plane { y, 0 texture {Gold} }
#declare thing = difference
{
box { <1,-1,1>, <-1,1,-1> }
box { <1,-1,1>, <-1,1,-1> translate < .05, -.05, .05> }
texture {Chrome}
}
object { // rotations in global coordinate space
thing
rotate -45.0*y
rotate sqrt(3/2)*45*x // x component
translate <0, sqrt(1/3), 0>
rotate -50*y
}
If you think about it as a series of transformations, the first rotation is
easy, but now the x axis is'nt where it was. It's rotated through 45 so you
must now figure the component of x to rotate in your global coordinate
system. Pythagoras is enough to get the ratios with the square roots.
DLM
"Maarten Boonen" <m44### [at] yahoo com> wrote in message
news:41f95360$1@news.povray.org...
> Bryan Valencia schreef:
>> This is 3 sides of a cube turned into a shelter on a very hot alien
>> world.
>> I had to use trial and error (because my math skills are lacking) to
>> figure
>> out how much to rotate and translate my box{-1,1} to make the cube sit
>> correctly on the plane{y,0} Can someone 'splain the math for me?
>
> Hi,
>
> Not really math, but this might help:
>
> camera { location <5,1,8> look_at 0 }
>
> light_source { 50 rgb 1 }
>
> plane { y, 0 pigment { rgbt <1,1,1,.5> } }
> plane { x, 0 pigment { rgbt <0,1,0,.5> } }
> plane { z, 0 pigment { rgbt <0,0,1,.5> } }
>
> difference
> {
> box { <1,0,1>, <-1,2,-1> }
> box { <1,0,1>, <-1,2,-1> translate <.1,-.1,.1> }
>
> translate <1,0,1>
> rotate y*-45
> translate <0,0,-1>
> rotate x*45
>
> pigment { rgb <1,0,0> }
> }
>
>
> Greetings,
>
> Maarten
Post a reply to this message
Attachments:
Download 'box2.jpg' (42 KB)
Preview of image 'box2.jpg'
![box2.jpg](/povray.binaries.images/attachment/%3C41fb138c%40news.povray.org%3E/box2.jpg?preview=1)
|
![](/i/fill.gif) |