POV-Ray : Newsgroups : povray.general : calculate and print coordinates : Re: calculate and print coordinates Server Time
31 Jul 2024 16:27:02 EDT (-0400)
  Re: calculate and print coordinates  
From: Chris B
Date: 20 Nov 2006 15:49:45
Message: <456214e9$1@news.povray.org>
"Maarten" <m44### [at] yahoocom> wrote in message 
news:web.45620c89733899c6ab0f85860@news.povray.org...
> Hi,
>
> Is it possible to do transformations (basic rotate, scale, translate) on a
> vector and then print out the result? e.g. something like
>
> #warning <1,0,0> rotate z*90
>
> I would like to use this to calculate the lowest point of my object, so I
> can lower it to the ground. Other solutions to this problem are also
> welcome.
>
> Thanks!
> Maarten
>

Hi Maarten,

The function vtransform() applies a transformation to a vector, returning a 
vector that you could write out into the message stream e.g.

#declare MyVector = vtransform(Vect, Trans);
#debug concat(vstr(3,MyVector,",",3,3)"\n")

To get the distance between the lowest point of the object and the ground 
you could use

#declare LowestPoint = min_extent(OBJECT_IDENTIFIER);
#declare DistanceToGround = LowestPoint.y - GroundElevation;


I didn't test any of these examples, so there may be syntax errors to fix.

Regards,
Chris B.


Post a reply to this message

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