|
|
On Fri, 21 Aug 2009 14:37:30 +0100, Stephen <mcavoysAT@aolDOTcom> wrote:
Sorry I messed up a post :(
As Warp says:
Yes you need to group your door and handle in a union and rotate that union. But
remember that every rotate is about the origin. You will need to translate your
objects to the appropriate position rotate the union and translate them back.
I don't hand code but use a modeller so I can't give you a written example. I
would create a union where the hinge would be add the objects to it then
subtract the translation of the union. But that maybe a roundabout way of
describing it.
--
Regards
Stephen
Post a reply to this message
|
|
|
|
"optima" <jes### [at] yahoocom> wrote:
> Hi,
> I want to attach the handle onto the door so that they rotate together. But no
> such luck after a few hours of trying. How can I move the handle with the door?
> Sample is complete with what you need to know for helping. Thank you very much.
> http://www.kitchendesigned.com/download/handle.zip
>
> I guess they need to be nested inside one another but how
> or should it be done some other way? Any help is appreciated.
>
> Ibrahim Dogan
I had a look at your code. The point of rotation would be along the hinges, not
the center. Also, the rotation in the scene file is 360 degrees, which would
appear to have no effect, since it is rotated completely back around to its
starting point. You have the right idea of translating it first, though.
Note that this statement here:
translate -x*CentrePoint.x translate -y*CentrePoint.y translate -z*CentrePoint.z
is identical to
translate -CentrePoint
Since CentrePoint is already a 3D vector, there is no need to break it into
components. Furthermore, changing the camera angle shows that the handle is
not connected, probably due to the transformation that is applied to it. Since
the door and handle do not move relative to one another, you should be applying
one singe transformation to the union consisting of the door and handle. The
case of the cabinet should be in its own union.
Further inspection shows that the handle's transformation appears to be correct.
The way it should be grouped is:
#declare case =
union{
// boxes for walls of cabinet
}
#declare door_and_handle =
union{
// door objects
// handle objects
}
// entire_cabinet:
union
{
object{ case }
object{ door_and_handle
// from the handle's old transformation
translate -<0,47.5,60> rotate y*-25 translate <0,47.5,60>
}
// any transformation for the entire cabinet,
// whether the door is opened or closed, would go here.
}
HTH
-Reactor
Post a reply to this message
|
|