POV-Ray : Newsgroups : povray.general : an extraordinary rotation question : Re: an extraordinary rotation question Server Time
30 Jul 2024 16:25:59 EDT (-0400)
  Re: an extraordinary rotation question  
From: Tim Attwood
Date: 23 Jun 2009 07:46:23
Message: <4a40c08f$1@news.povray.org>
> 1- // the angled cabinet
> object {
>   CABINET
>   translate <0,0,60> // place front-left-bottom corner on origin
> 1- Why do we translate to <0,0,60>, what if I want to rotate around right 
> front
> corner then what would this value be ? I think this point needs 
> elaboration.
> Did you multiply <-0.5,-0.5,0>*<x,x,x>?

The meshes are 100 wide by 100 tall by 100 deep.
So after aligning everything at that size, it's all scaled
by scale <0.5,0.75,0.6>... so that's
<100,100,-100>*<0.5,0.75,0.6> = <50,75,-60>
which is the coordinates of the top-right-forward
corner, but it's also the dimensions, since the opposite
corner is on <0,0,0>.

The reason it's translated by <0,0,60> is to put the
left-front corner on the origin for rotatation around
the Y axis.

If you wanted to rotate arount the front-right corner,
then you'd translate by <-50,0,60>, putting the
front-right corner on the origin before rotating.
Then you place it with another translation.

> 2- Declaring a Cabinet Union, then just copying and placing them on the 
> scene is
> brilliant. That's the route I want to go for each similar object. But each
> cabinet may have different texture, handle, door model applied to it.
> So in
> // the left cabinet
> object {
>   CABINET
>   translate <0,0,0>
>   rotate <0,0,0>
>   translate <0,10,0> // raise bottom of cabinet to kick height
> }
> How should I proceed to reflect these different characteristics in the 
> object?

Yeah, you probably will end up with a union for every unique cabinet,
that's normal. You'll need to number them or something. You might
end up with different shelving options for the cases too? It doesn't
matter much, with the doors closed you can't see the inside.
If you plan to open any of the doors, then you should keep track
of the hinge location, that way you can move the cabinet so that
the Y axis lines up along the hinges, rotate open the door (in the union)
and then place it back.

The more complicated your meshes get the harder it'll be to determine
where the corners of your mesh object are. It's worth the small amount
of time it takes to try to line up a corner with the origin in your
modeling package. That way you can just import the meshes,
and then place them into a union without having to manually
re-align each part.


Post a reply to this message

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