POV-Ray : Newsgroups : povray.binaries.images : Makeshift Shelter : Re: Makeshift Shelter Server Time
9 Aug 2024 15:22:43 EDT (-0400)
  Re: Makeshift Shelter  
From: dlm
Date: 28 Jan 2005 23:39:40
Message: <41fb138c@news.povray.org>
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] yahoocom> 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


 

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