POV-Ray : Newsgroups : povray.general : an extraordinary rotation question : Re: an extraordinary rotation question Server Time
30 Jul 2024 14:19:12 EDT (-0400)
  Re: an extraordinary rotation question  
From: Tim Attwood
Date: 21 Jun 2009 06:53:50
Message: <4a3e113e$1@news.povray.org>
> 1- In the example you provided one of the corners is
> at <-49.999,-49.999,0.001>, and another at
> <50.001,50.001,100.001>.
> 1- Where are these numbers showing in my sample?

The numbers are in the file "box_POV_geom.inc",
as part of the mesh2 definition.

> 2- When you scale you are relocating the corners around the origin by
> multiplication. So
> 0.01*<-49.999,-49.999,0.001> = <-0.5,-0.5,0>, and
> 0.01*<50.001,50.001,100.001> = <0.5,0.5,1>
>
> 2- Why do you multiply 0.01*<-49.999,-49.999,0.001> = <-0.5,-0.5,0>, and
>                       0.01*<50.001,50.001,100.001> = <0.5,0.5,1>

<50.001,50.001,100.001> is the upper-right-rear corner of the
box. Again, this is from "box_POV_geom.inc", the multiplication
by 0.01 comes from the scale in line 20 of "rotation.pov"

#declare BOX = object { box_  scale <0.01,0.01,0.01> translate <0, 0, 0> }

Note that translate <0,0,0> doesn't do anything and could be omited.
So we have here the coordinates of two corners of the mesh2 "box_",
which is redeclared as "BOX" and scaled.

> 3- So then you have your first wall so you scale by
> <250,260,10>*<-0.5,-0.5,0>= <-125,-130,0>, and
> <250,260,10>*<0.5,0.5,1>=<125,130,10>
>
> 3- Why these 2 multiplications take place?

In line 25 of "rotation.pov" you scale "BOX".
So these are the coordinates of the object statement started on
line 24, as of the scaling. It's translated later in line 27.

> 4- <-0.5,-0.5,0> is the coordinate of of the lower-left-forward corner
> of the BOX mesh, which is the _box mesh <-49.999,-49.999,0.001>
> scaled by 0.01 (and rounded a bit).
>
> 4- Where does it say <-0.5,-0.5,0> is the lower left forward corner of 
> BOX?

POV by default uses a left handed coordinate system... so plus Y is
up, plus X is right, plus Z is away. It's called left handed because
you can hold your left hand with the thumb up (Y), the pointer finger
forward (Z), and the middle finger right (X) to visualize the XYZ axis.
You can also picture the direction of rotations that way. If you make
the XYZ axis with your left hand, then if you trace from the palm
of the left hand over the middle finger, that's positive X, and
continue tracing over the middle finger, that's positive Z, and then
tward you around the thumb, that's positive Y.

So it's that corner because it was the vector with the minimum values.
Note that in this case the corner happened to be equal to the result
of the min_extent function, but it's not required to be equal.

> 5- So the first wall is equivalent to
> box{<-250,0,-3.5>,<0,260,6.5>}
>
> 5- is <-250,0,-3.5> translate or scale, same question for >,<0,260,6.5>
Yeah, box{<-250,0,-3.5>,<0,260,6.5>} should be equivalent to
the first wall, as per line 24-28 of "rotation.pov", that's what
is going on. It's just a mental stand-in for the mesh, which in
the sample is actually a box, but if the mesh is somewhat box-like
(say a cabinet) it's still a valid picture of where it is.

> 6- So for this example I'll pick a corner... <-100,-130,0>
> 6- Which corner is this and how did the number came to be <-100,-130,0>

It's the front-left-bottom corner of the second wall,
declared as "ek_duvar12" in line 33-41 of "rotation.pov".
Which is  <-0.5,-0.5,0>*<200,260,15>, the
corner of "BOX" scaled as per line 36.


Post a reply to this message

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