POV-Ray : Newsgroups : povray.newusers : Transforming transformation matrix to POV-ray format : Re: Transforming transformation matrix to POV-ray format Server Time
23 Jun 2024 06:56:57 EDT (-0400)
  Re: Transforming transformation matrix to POV-ray format  
From: Bald Eagle
Date: 7 Dec 2022 13:40:00
Message: <web.6390dcfa7706afa61f9dae3025979125@news.povray.org>
So, it looks to me like you're trying to take a mesh bottle and put it in the
same place as the bottle in the image.
I'm also assuming that your image is on the xz plane.

I think what you ought to do is take your mesh, determine the bounding box, and
then position the mesh so that it is centered on the y axis, and its bottom is
at y=0.

#declare Min = min_extent {your mesh};
#declare Max = max_extent {your mesh};

#declare Center = (x+z)*(Min+Max)/2;
#declare Y_adjust = (Max.y-Min.y)/2;
object {your mesh translate -Center translate y*Y_adjust}

(That's all untested, so check it)

Then you can just translate the object to anywhere you want, knowing that it's
now centered, with the bottom at the origin.

If you're trying to flip something from right to left, the easiest way is to
just scale -x.

Post a reply to this message

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