POV-Ray : Newsgroups : povray.general : calculate and print coordinates Server Time
28 Nov 2024 14:51:51 EST (-0500)
  calculate and print coordinates (Message 1 to 4 of 4)  
From: Maarten
Subject: calculate and print coordinates
Date: 20 Nov 2006 15:15:01
Message: <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


Post a reply to this message

From: Chris B
Subject: Re: calculate and print coordinates
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

From: Thorsten Froehlich
Subject: Re: calculate and print coordinates
Date: 20 Nov 2006 15:57:32
Message: <456216bc$1@news.povray.org>
Maarten wrote:
> 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

Check out vrotate, one of the available vector functions:
<http://www.povray.org/documentation/view/3.6.1/229/>

Further, check out vstr, one of the available string functions:
<http://www.povray.org/documentation/view/3.6.1/232/>

	Thorsten


Post a reply to this message

From: Maarten
Subject: Re: calculate and print coordinates
Date: 20 Nov 2006 16:35:00
Message: <web.45621f5e1d4727e8ab0f85860@news.povray.org>
Thorsten Froehlich <tho### [at] trfde> wrote:
> Maarten wrote:
> > 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
>
> Check out vrotate, one of the available vector functions:
> <http://www.povray.org/documentation/view/3.6.1/229/>
>
> Further, check out vstr, one of the available string functions:
> <http://www.povray.org/documentation/view/3.6.1/232/>
>
>  Thorsten

Chris and Thorsten:

Thanks a lot, both of you!
This is exactly what I needed. (Also thanks to POV for supporting it :))

Regards,
Maarten


Post a reply to this message

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