POV-Ray : Newsgroups : povray.advanced-users : i still do not have an answer yet Server Time
30 Jul 2024 00:24:01 EDT (-0400)
  i still do not have an answer yet (Message 11 to 14 of 14)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Adam Gibbons
Subject: Re: i still do not have an answer yet
Date: 15 Jan 2001 20:43:27
Message: <3a63a73f@news.povray.org>
does vrotate work under povray 3.1g for windows ??!!

"Warp" <war### [at] tagpovrayorg> wrote in message
news:3a62ba2f@news.povray.org...
>   So what you want is just a vector telling you the location of the
object.
> You don't need to calculate the result by yourself but you can let povray
> do it, as others have already answered.
>   If you are using megapov, you can declare all the transformations in one
> identifier and then apply the same transformation to the object and to
> a vector (with vtransform), as already pointed out.
>   It's also good to know how to make the individual transformations to a
> vector:
>
> translate <a,b,c>  <=>  #declare Vector = Vector + <a,b,c>;
>     scale <a,b,c>  <=>  #declare Vector = Vector * <a,b,c>;
>    rotate <a,b,c>  <=>  #declare Vector = vrotate(Vector, <a,b,c>);
>
>   If you want to make the individual transformations to the vector (eg.
because
> you don't have megapov to use vtransform, or for other reason), just apply
> the abovementioned equivalent operations.
>   For example:
>
> sphere
> { 0, 1  #declare Loc = <0,0,0>;
>   translate <1,2,-3>  #declare Loc = Loc + <1,2,-3>;
>   rotate y*30  #declare Loc = vrotate(Loc, y*30);
>   translate -x*2  #declare Loc = Loc - x*2;
>   scale .5  #declare Loc = Loc * .5;
> }
>
>   Now 'Loc' will be the coordinate of the center of the sphere.
>
> --
> char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
> main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
> c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: i still do not have an answer yet
Date: 15 Jan 2001 21:47:26
Message: <chrishuff-42A9CF.21484915012001@news.povray.org>
In article <3a63a73f@news.povray.org>, "Adam Gibbons" 
<Fie### [at] emailcom> wrote:

> does vrotate work under povray 3.1g for windows ??!!

Yes, the vrotate() function is part of the official version. However, 
the vtransform() function isn't, it is a patch that I wrote, but it is 
in MegaPOV and will eventually be in POV 3.5. You could imitate it 
partially with macros, like:
#macro VTranslate(V, Translation) (V+Translation) #end
#macro VScale(V, Translation) (V*Translation) #end

Another function in the official version that you may find useful is 
vaxis_rotate(), which rotates a point around a given axis by a specified 
number of degrees instead of x, y, then z.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Warp
Subject: Re: i still do not have an answer yet
Date: 16 Jan 2001 11:46:19
Message: <3a647ada@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: #macro VScale(V, Translation) (V*Translation) #end

  Your choice of parameter name is not the best possible ;)

: Another function in the official version that you may find useful is 
: vaxis_rotate(), which rotates a point around a given axis by a specified 
: number of degrees instead of x, y, then z.

  A macro that applies an axis_rotate to an object is not too difficult to
do either (I think someone has already done it; and it can be found in
the matrix page iirc).

-- 
char*i="b[7FK@`3NB6>B:b3O6>:B:b3O6><`3:;8:6f733:>::b?7B>:>^B>C73;S1";
main(_,c,m){for(m=32;c=*i++-49;c&m?puts(""):m)for(_=(
c/4)&7;putchar(m),_--?m:(_=(1<<(c&3))-1,(m^=3)&3););}    /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: i still do not have an answer yet
Date: 16 Jan 2001 15:50:32
Message: <chrishuff-3F5C60.15513516012001@news.povray.org>
In article <3a647ada@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

> : #macro VScale(V, Translation) (V*Translation) #end
> 
>   Your choice of parameter name is not the best possible ;)

That's what I get for copy-pasting too much... :-)


>   A macro that applies an axis_rotate to an object is not too difficult 
> to do either (I think someone has already done it; and it can be 
> found in the matrix page iirc).

There is one on the Thoroughly Useful Macros page, it's called 
AxisRotate().
http://enphilistor.users4.50megs.com/macs.htm

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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