POV-Ray : Newsgroups : povray.general : How to find Coordinates of a point ??? Server Time
17 Nov 2024 01:12:49 EST (-0500)
  How to find Coordinates of a point ??? (Message 1 to 4 of 4)  
From: BorisW37
Subject: How to find Coordinates of a point ???
Date: 10 Jul 2003 17:50:01
Message: <web.3f0dde6738f0fa473c07ae1f0@news.povray.org>
Lets say i have a sphere centered <x1,y1,z1> then i rotate it
<ang_x,ang_y,ang_z>
How do i find the new coordinates of the sphere's center <x2,y2,z3> ?

Thank you,

Boris.


Post a reply to this message

From: Zeger Knaepen
Subject: Re: How to find Coordinates of a point ???
Date: 10 Jul 2003 18:23:36
Message: <3f0de768$1@news.povray.org>
"BorisW37" <Bor### [at] yahoocom> schreef in bericht
news:web.3f0dde6738f0fa473c07ae1f0@news.povray.org...
> Lets say i have a sphere centered <x1,y1,z1> then i rotate it
> <ang_x,ang_y,ang_z>
> How do i find the new coordinates of the sphere's center <x2,y2,z3> ?

#declare NewCoordinates = vrotate(<x1,y1,z1>,<ang_x,ang_y,ang_z>);

cu!
--
camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
<.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf


Post a reply to this message

From: BorisW37
Subject: Re: How to find Coordinates of a point ???
Date: 10 Jul 2003 20:30:02
Message: <web.3f0e049f27c93dad3c07ae1f0@news.povray.org>
I have never used macros before, could you explain how this macro works.

Zeger Knaepen wrote:
>"BorisW37" <Bor### [at] yahoocom> schreef in bericht
>news:web.3f0dde6738f0fa473c07ae1f0[at]news.povray.org...
>> Lets say i have a sphere centered <x1,y1,z1> then i rotate it
>> <ang_x,ang_y,ang_z>
>> How do i find the new coordinates of the sphere's center <x2,y2,z3> ?
>
>#declare NewCoordinates = vrotate(<x1,y1,z1>,<ang_x,ang_y,ang_z>);
>
>cu!
>--
>camera{location-z*3}#macro G(b,e)b+(e-b)*(C/50)#end#macro L(b,e,k,l)#local C=0
>;#while(C<50)sphere{G(b,e),.1pigment{rgb G(k,l)}finish{ambient 1}}#local C=C+1
>;#end#end L(y-x,y,x,x+y)L(y,-x-y,x+y,y)L(-x-y,-y,y,y+z)L(-y,y,y+z,x+y)L(0,x+y,
><.5,1,.5>,x)L(0,x-y,<.5,1,.5>,x)               // ZK http://www.povplace.be.tf
>


Post a reply to this message

From:
Subject: Re: How to find Coordinates of a point ???
Date: 10 Jul 2003 22:46:10
Message: <3f0e24f2$1@news.povray.org>
"vrotate" is not a macro, it's an inbuilt vector function. Given
the coordinate vector of a point and a vector of three angles (as
with "translate"), it calculates the coordinate vector of the point
after these rotations. See 6.1.4.6: "Vector Functions" in the doc.

The code in the last 4 lines is a signature: just render these lines
in POV-Ray and see ...

   Sputnik


Post a reply to this message

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