|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Hi all.
I've been staring at this for 20 minutes and I'm obviously missing
something really obvious. Would one of you be kind enough to point out
my mistake?
I want to stand a box on one corner (so the lowest corner is at the
origin) and rotate it about the y axis (which should pass directly
through the upper/lower corners).
box {-.5,.5
texture{BoxTexture}
rotate 45*z
rotate 45*x
translate y*pow(3,.5)/2
rotate -y*(30+clock*360)
}
I also have a plane {y,0} with a reflective texture. The tip of the
reflection and box come _very_ close but do not quite touch (more than
an AA artifact).
When the cube is rotated, the top/bottom corners describe small circles
horizontally - Which leads me to conclude I haven't rotated the cube
correctly - but 45/45 seems intuitively correct?
What am I doing wrong when orientating the box?
Sorry to have to ask such a simple question - I've just been staring at
it too long
Many thanks in advance
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> I've been staring at this for 20 minutes and I'm obviously missing
> something really obvious. Would one of you be kind enough to point out
> my mistake?
The front left bottom corner (A),
the rear right bottom corner (B),
and rear right upper corner (C),
form a right triangle ABC where
length AB = sqrt 2
length BC = 1
length CA = sqrt 3
so the angles are
BAC = 35.264389
ACB = 54.735610
ABC = 90
so
box {0,1
rotate 45*y
rotate 54.73561*z
... etc
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Hi all.
>
> I've been staring at this for 20 minutes and I'm obviously missing
> something really obvious. Would one of you be kind enough to point out
> my mistake?
>
> I want to stand a box on one corner (so the lowest corner is at the
> origin) and rotate it about the y axis (which should pass directly
> through the upper/lower corners).
>
> box {-.5,.5
> texture{BoxTexture}
> rotate 45*z
> rotate 45*x
> translate y*pow(3,.5)/2
> rotate -y*(30+clock*360)
> }
>
> I also have a plane {y,0} with a reflective texture. The tip of the
> reflection and box come _very_ close but do not quite touch (more than
> an AA artifact).
>
> When the cube is rotated, the top/bottom corners describe small circles
> horizontally - Which leads me to conclude I haven't rotated the cube
> correctly - but 45/45 seems intuitively correct?
>
> What am I doing wrong when orientating the box?
>
> Sorry to have to ask such a simple question - I've just been staring at
> it too long
>
> Many thanks in advance
>
Start your box as:
box{0,1...}
That way, you start with a corner exactly at the origin, eliminating any
need to translate it. Without any translation, the lower corner will
exactly touch your plane at 0,y and the y rotation will be around it
without any chance of it moving.
Sometimes, as in this particuliar case, creating the object around the
origin is not the best way. Creating it with a specific point at the
origin is the best way.
Then, you rotate it as Tim explaned.
For any object destined to rest on another, like on a floor, if's often
beter to create it with it's base at 0*y. It's beter to create a door
with one of it's edge at 0*x and 0*z and it's base slightly raised:
0.1*y for example.
Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
That'll teach me not to assume :)
Thanks
"Tim Attwood" <tim### [at] anti-spamcomcastnet> wrote in message
news:4b99cf13@news.povray.org:
> > I've been staring at this for 20 minutes and I'm obviously missing
> > something really obvious. Would one of you be kind enough to point out
> > my mistake?
>
> The front left bottom corner (A),
> the rear right bottom corner (B),
> and rear right upper corner (C),
> form a right triangle ABC where
> length AB = sqrt 2
> length BC = 1
> length CA = sqrt 3
> so the angles are
> BAC = 35.264389
> ACB = 54.735610
> ABC = 90
> so
>
> box {0,1
> rotate 45*y
> rotate 54.73561*z
> ... etc
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
That's far simpler and more elegant. I must really be having an off-day
:s
Thanks
"Alain" <aze### [at] qwertyorg> wrote in message
news:4b9a97c1$1@news.povray.org:
> > Hi all.
> >
> > I've been staring at this for 20 minutes and I'm obviously missing
> > something really obvious. Would one of you be kind enough to point out
> > my mistake?
> >
> > I want to stand a box on one corner (so the lowest corner is at the
> > origin) and rotate it about the y axis (which should pass directly
> > through the upper/lower corners).
> >
> > box {-.5,.5
> > texture{BoxTexture}
> > rotate 45*z
> > rotate 45*x
> > translate y*pow(3,.5)/2
> > rotate -y*(30+clock*360)
> > }
> >
> > I also have a plane {y,0} with a reflective texture. The tip of the
> > reflection and box come _very_ close but do not quite touch (more than
> > an AA artifact).
> >
> > When the cube is rotated, the top/bottom corners describe small circles
> > horizontally - Which leads me to conclude I haven't rotated the cube
> > correctly - but 45/45 seems intuitively correct?
> >
> > What am I doing wrong when orientating the box?
> >
> > Sorry to have to ask such a simple question - I've just been staring at
> > it too long
> >
> > Many thanks in advance
> >
>
> Start your box as:
> box{0,1...}
>
> That way, you start with a corner exactly at the origin, eliminating any
> need to translate it. Without any translation, the lower corner will
> exactly touch your plane at 0,y and the y rotation will be around it
> without any chance of it moving.
>
> Sometimes, as in this particuliar case, creating the object around the
> origin is not the best way. Creating it with a specific point at the
> origin is the best way.
>
> Then, you rotate it as Tim explaned.
>
> For any object destined to rest on another, like on a floor, if's often
> beter to create it with it's base at 0*y. It's beter to create a door
> with one of it's edge at 0*x and 0*z and it's base slightly raised:
> 0.1*y for example.
>
>
>
> Alain
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|