POV-Ray : Newsgroups : povray.advanced-users : can some one help me with rotational extrapolation !!! ? Server Time
26 Nov 2024 04:48:43 EST (-0500)
  can some one help me with rotational extrapolation !!! ? (Message 1 to 8 of 8)  
From: Adam Gibbons
Subject: can some one help me with rotational extrapolation !!! ?
Date: 9 Jan 2001 19:26:24
Message: <3a5bac30@news.povray.org>
hi there my name is Adam and I am currently working on this POV-RAY picture.
but I am stuck, before I tell you what I am stuck on I thought I should give
you some back ground info on what it is I am stuck on. just so you know what
it is I am going on about.

if we take for example: - (this simple shape)

sphere
{

<0.68,(0.425/2)+0.09,0>0.1
translate <0,0.85,0>
scale <0.75,0.75,0.75>
rotate < 10 ,-45, -20>
translate <-0.7,-0.1, 00>
pigment{Red}
}

you can see that its position in 3D space is given by many commands, first a
location which is moved then rotated and then scaled and then moved again.
by this time the shape is getting dizzy.

but through extrapolation you can eliminate each of these steps to exactly
the same shape in the same XYZ coordinates and the same size.

E.G..

<0.68,(0.425/2)+0.09,0> translated by <0,0.85,0> becomes <0.68,0.3025,0.00>

<0.68,(0.425/2)+0.09,0>
+                   <0,0.85,0>
=      <0.68,0.3025,0.00>

do you see ?? well I hope so because that is just the beginning....

NEXT

<0.68,0.3025,0.00> is Scaled by <0.75,0.75,0.75> which can be turned into
<0.51,0.8643750,0.00>
<0.68,0.3025,0.00>
*  <0.75,0.75,0.75>
= <0.51,0.8643750,0.00>

SO if we now uses the code: -

 <0.51,0.8643750,0>0.1
 rotate < 10 ,-45, -20>
 translate <-0.7,-0.1, 00>
 pigment{Red}
 }

basically all we have done is taken

(  <0.68,(0.425/2)+0.09,0>  +  <0,0.85,0>  )  *  <0.75,0.75,0.75

= <0.51,0.8643750,0>

 [ we have extrapolated these new co-ordinates from some existing ones and a
set of instructions ]

we get exactly the same shape in the same place and it is much easier to
understand exactly where it is.

but this is where I get stuck you may notice there is a rotation left in the
statement, and also another translation. I can do the translation that is
easy. It is the rotation that I am finding hard. as you will know if you
move an object and then choose to rotate it, it rotates as through a piece
of string is attached to <0,0,0> what is that I here you say why not rotate
the object before I move it. well because then it will not be in the exact
right place and I will have to start moving it little by little in my scene
to get it in just the right place. and that would take far to long. what I
need is a way or a formula so that I can take my existing co-ordinates and
then by using some method of rotational extrapolation gain the new set of
co-ordinates. in a similar way that I managed to do the examples above.

if some one out there can tell me how you do this then not only would I be
most grateful BUT I will make a windows application that will allow people
to easily do extrapolation in the future and I will make it totally free for
every one at POV-RAY to use. that is after I have finished making the dam
thing.

please there must be some POV-RAY guru out there that can help me
extrapolate these new co-ordinates from this rotational statement. if you
can help me then please feel free to email me at this address
Fie### [at] emailcom

thanks

Adam =B)


Post a reply to this message

From: Chris Huff
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 9 Jan 2001 21:05:27
Message: <chrishuff-32ACDA.21070609012001@news.povray.org>
Well, the vrotate() function may do what you want. It takes a point and 
rotation vector, and returns the result of rotating that point.
The vtransform() function in MegaPOV may also be helpful to you, it 
takes actual transformations instead of just a rotation vector, but you 
have to use a non-standard version of POV.

About a separate program that does this: I'm not sure how useful that 
would be. The scale, rotate, and matrix transformations can change 
orientation and shape as well as position, and I don't think raw numbers 
representing a point will be very useful in visualizing transformations.
And calculating a position with an external program and entering it into 
the scene file won't be as precise as entering the transformations 
themselves, and the result won't be anywhere near as readable. (How is 
someone reading the source supposed to know that a sphere at 
xx.xxxxxxxxxxxxx is the result of a simple translation and rotation?)

If you just want the math, you can find it on one of the matrix tutorial 
pages, like http://enphilistor.users4.50megs.com/matrix.htm, or look in 
the POV-Ray source code(matrices.c, Compute_Rotation_Transform()).

-- 
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: David Fontaine
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 9 Jan 2001 23:45:34
Message: <3A5BE7C7.CAAFFBB3@faricy.net>
This is basically vectors and matrices.

The matrices for the different transforms and a basic explanation of how they
work is here, but it won't tell you the basics of matrix math like multiplying
etc: http://davidf.faricy.net/povre.html#Matrices (nothing like a little website
promotion)

If you don't know about matrix math tell me and I'll explain a little.

--
David Fontaine  <dav### [at] faricynet>  ICQ 55354965
My raytracing gallery:  http://davidf.faricy.net/


Post a reply to this message

From: Wlodzimierz ABX Skiba
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 10 Jan 2001 04:38:45
Message: <3a5c2da5@news.povray.org>
Adam Gibbons wrote in message <3a5bac30@news.povray.org>...
> if some one out there can tell me how you do this then not only would I be
> most grateful BUT I will make a windows application that will allow people
> to easily do extrapolation in the future and I will make it totally free for
> every one at POV-RAY to use. that is after I have finished making the dam
> thing.


everything what you need is set of some macros working in MegaPov
but this could be possible in pure POV

#macro TransformObjectAndPoints(Trans)
  #local counter=0;
  #while (defined(ControlPoints[counter]))
    #declare ControlPoints[counter]=vtransform(ControlPoints[counter],Trans);
    #local counter=counter+1;
  #end
  transform Trans
#end

#macro RotateObjectAndPoints(Angle)
  #local Trans=transform{rotate Angle}
  TransformObjectAndPoints(Trans)
#end

#macro ScaleObjectAndPoints(S)
  #local Trans=transform{scale S}
  TransformObjectAndPoints(Trans)
#end

#macro TranslateObjectAndPoints(Vector)
  #local Trans=transform{translate Vector}
  TransformObjectAndPoints(Trans)
#end

and now your scene

#declare ControlPoints=array[2]
// center of sphere
#declare ControlPoints[0]=<0.68,(0.425/2)+0.09,0>;
// radius and point somwhere on sphere
#declare Radius=0.1
#declare ControlPoints[1]=ControlPoints[0]+(Radius*y);

sphere
{
ControlPoints[0] Radius
TranslateObjectAndPoints(<0,0.85,0>)
ScaleObjectAndPoints(<0.75,0.75,0.75>)
RotateObjectAndPoints(< 10 ,-45, -20>)
TranslateObjectAndPoints(<-0.7,-0.1, 00>)
pigment{Red}
}

#declare NewCenter = ControlPoints[0];
#declare NewRadius = vlength(ControlPoints[1]-ControlPoints[0]);

this is not tested but I hope it works

ABX


Post a reply to this message

From: Warp
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 10 Jan 2001 06:17:05
Message: <3a5c44b0@news.povray.org>
Adam Gibbons <Fie### [at] emailcom> wrote:
: we get exactly the same shape in the same place and it is much easier to
: understand exactly where it is.

  Not everybody agrees with that.

: please there must be some POV-RAY guru out there that can help me
: extrapolate these new co-ordinates from this rotational statement.

  The easiest and most intuitive way is using the rotate. Why use anything
else?

  If you REALLY need a vector in that place, use vrotate().

: if you
: can help me then please feel free to email me at this address
: Fie### [at] emailcom

  It's usually polite to expect an answer in the newsgroup where the question
was posted.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Adam Gibbons
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 10 Jan 2001 17:41:04
Message: <3a5ce500@news.povray.org>
Thanks very much for your help

"Chris Huff" <chr### [at] maccom> wrote in message
news:chrishuff-32ACDA.21070609012001@news.povray.org...
> Well, the vrotate() function may do what you want. It takes a point and
> rotation vector, and returns the result of rotating that point.
> The vtransform() function in MegaPOV may also be helpful to you, it
> takes actual transformations instead of just a rotation vector, but you
> have to use a non-standard version of POV.
>
> About a separate program that does this: I'm not sure how useful that
> would be. The scale, rotate, and matrix transformations can change
> orientation and shape as well as position, and I don't think raw numbers
> representing a point will be very useful in visualizing transformations.
> And calculating a position with an external program and entering it into
> the scene file won't be as precise as entering the transformations
> themselves, and the result won't be anywhere near as readable. (How is
> someone reading the source supposed to know that a sphere at
> xx.xxxxxxxxxxxxx is the result of a simple translation and rotation?)
>
> If you just want the math, you can find it on one of the matrix tutorial
> pages, like http://enphilistor.users4.50megs.com/matrix.htm, or look in
> the POV-Ray source code(matrices.c, Compute_Rotation_Transform()).
>
> --
> 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: Adam Gibbons
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 10 Jan 2001 18:13:55
Message: <3a5cecb3@news.povray.org>
Thanks very much for you help.


"David Fontaine" <dav### [at] faricynet> wrote in message
news:3A5BE7C7.CAAFFBB3@faricy.net...
> This is basically vectors and matrices.
>
> The matrices for the different transforms and a basic explanation of how
they
> work is here, but it won't tell you the basics of matrix math like
multiplying
> etc: http://davidf.faricy.net/povre.html#Matrices (nothing like a little
website
> promotion)
>
> If you don't know about matrix math tell me and I'll explain a little.
>
> --
> David Fontaine  <dav### [at] faricynet>  ICQ 55354965
> My raytracing gallery:  http://davidf.faricy.net/
>
>


Post a reply to this message

From: Adam Gibbons
Subject: Re: can some one help me with rotational extrapolation !!! ?
Date: 10 Jan 2001 18:13:58
Message: <3a5cecb6@news.povray.org>
Thanks very much for you help.


"Wlodzimierz ABX Skiba" <abx### [at] abxartpl> wrote in message
news:3a5c2da5@news.povray.org...
> Adam Gibbons wrote in message <3a5bac30@news.povray.org>...
> > if some one out there can tell me how you do this then not only would I
be
> > most grateful BUT I will make a windows application that will allow
people
> > to easily do extrapolation in the future and I will make it totally free
for
> > every one at POV-RAY to use. that is after I have finished making the
dam
> > thing.
>
>
> everything what you need is set of some macros working in MegaPov
> but this could be possible in pure POV
>
> #macro TransformObjectAndPoints(Trans)
>   #local counter=0;
>   #while (defined(ControlPoints[counter]))
>     #declare
ControlPoints[counter]=vtransform(ControlPoints[counter],Trans);
>     #local counter=counter+1;
>   #end
>   transform Trans
> #end
>
> #macro RotateObjectAndPoints(Angle)
>   #local Trans=transform{rotate Angle}
>   TransformObjectAndPoints(Trans)
> #end
>
> #macro ScaleObjectAndPoints(S)
>   #local Trans=transform{scale S}
>   TransformObjectAndPoints(Trans)
> #end
>
> #macro TranslateObjectAndPoints(Vector)
>   #local Trans=transform{translate Vector}
>   TransformObjectAndPoints(Trans)
> #end
>
> and now your scene
>
> #declare ControlPoints=array[2]
> // center of sphere
> #declare ControlPoints[0]=<0.68,(0.425/2)+0.09,0>;
> // radius and point somwhere on sphere
> #declare Radius=0.1
> #declare ControlPoints[1]=ControlPoints[0]+(Radius*y);
>
> sphere
> {
> ControlPoints[0] Radius
> TranslateObjectAndPoints(<0,0.85,0>)
> ScaleObjectAndPoints(<0.75,0.75,0.75>)
> RotateObjectAndPoints(< 10 ,-45, -20>)
> TranslateObjectAndPoints(<-0.7,-0.1, 00>)
> pigment{Red}
> }
>
> #declare NewCenter = ControlPoints[0];
> #declare NewRadius = vlength(ControlPoints[1]-ControlPoints[0]);
>
> this is not tested but I hope it works
>
> ABX
>
>


Post a reply to this message

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