POV-Ray : Newsgroups : povray.newusers : A case of the supids Server Time
4 Jul 2024 14:34:17 EDT (-0400)
  A case of the supids (Message 1 to 5 of 5)  
From: Simon
Subject: A case of the supids
Date: 11 Mar 2010 19:43:49
Message: <4b998e45$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


Post a reply to this message

From: Tim Attwood
Subject: Re: A case of the supids
Date: 12 Mar 2010 00:20:19
Message: <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

From: Alain
Subject: Re: A case of the supids
Date: 12 Mar 2010 14:36:33
Message: <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

From: Simon
Subject: Re: A case of the supids
Date: 12 Mar 2010 17:05:30
Message: <4b9abaaa$1@news.povray.org>
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

From: Simon
Subject: Re: A case of the supids
Date: 12 Mar 2010 17:05:57
Message: <4b9abac5@news.povray.org>
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

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