|
|
|
|
|
|
| |
| |
|
|
From: Edwin Miller
Subject: matrix (components as functions of the coordinates)
Date: 12 Jun 2003 19:36:23
Message: <3ee90e76@news.povray.org>
|
|
|
| |
| |
|
|
Hi, I`ve got a question about the matrix keyword...
Is there any way to create a (matrix) transformation in POVRAY with
the matrix components V00 .. V32 (as descripted in the manual) as
functions of the image coordinates px, py, pz?
I wanted to create a "cone" with the base just like a ellipse and the
top just like a normal circle. Therefor I have to scale the original cone
at the base with something like <1,1,0.5> and at the top with <1,1,1>,
between these both position scaling like a linear function.
If there's no way to solve this problem with the matrix keyword,
is there any other way to do?
thanks...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Wasn't it Edwin Miller who wrote:
>I wanted to create a "cone" with the base just like a ellipse and the
>top just like a normal circle. Therefor I have to scale the original cone
>at the base with something like <1,1,0.5> and at the top with <1,1,1>,
>between these both position scaling like a linear function.
>
>If there's no way to solve this problem with the matrix keyword,
>is there any other way to do?
You could do it with an isosurface.
This spline-driven parametric isosurface gives an open "cone" that
varies from <1,1,0.5> to <1,1,1>. (For speed you could use Ingo's
param.inc.)
// Cone with an elliptical base and circular top
#version 3.5;
camera { location <3, 3, -5> look_at <0, 0.5, 0> angle 20}
light_source {<100,200,-500> colour rgb 1}
// The spline that defines the edges of the "cone"
#declare S = function {
spline {
linear_spline
0, <1, 1, 0.5>,
1, <1, 1, 1>
}
}
// The Fx and Fy functions are derived from the
// X and Y values of the spline
#declare Fx = function(x,y) {(S(u).x * sin(v)/2)}
#declare Fy = function(x,y) {u}
#declare Fz = function(x,y) {(S(u).z * cos(v)/2)}
// The U parameter controls the Y height
#declare Umin = 0;
#declare Umax = 1;
// The V value goes round the circumpherence
// plus a little overlap to prevent an edge artefact
#declare Vmin = -pi;
#declare Vmax = 1.001*pi;
// The isosurface
parametric {
function {Fx(u,v)}
function {Fy(u,v)}
function {Fz(u,v)}
<Umin,Vmin>,<Umax,Vmax>
contained_by{box{<-1,0,-1><1,1,1>}}
precompute 18, x,y,z
pigment {rgb 0.9}
finish {phong 0.5 phong_size 10 ambient 0.2}
}
plane {y,0 pigment {rgb 1}}
======================================================
This isosurface gives a closed shape and renders much faster,
unfortunately the sides aren't quite straight.
// Cone with an elliptical base and circular top
#version 3.5;
camera { location <10, 5, -10> look_at <0, 0.5, 0> angle 10 }
light_source {<0,100,-100> colour rgb 1}
background {rgb 0.3}
// This function would give an ordinary cylinder
#declare F=function { x*x + z*z - 0.25}
// The Z value is then transformed by z*(2-y)
// which gives z*1 at the top when y=1
// and z*2 at the bottom when y=0
isosurface {
function {F(x,y,z*(2-y))}
max_gradient 5.5
contained_by{box {<-1,0,-1><1,1,1>}}
pigment {rgb .9}
finish {phong 0.5 phong_size 10}
}
plane {y,0 pigment {rgb 1}}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In article <3ee90e76@news.povray.org>,
Edwin Miller <edw### [at] webde> wrote:
> Is there any way to create a (matrix) transformation in POVRAY with
> the matrix components V00 .. V32 (as descripted in the manual) as
> functions of the image coordinates px, py, pz?
>
> I wanted to create a "cone" with the base just like a ellipse and the
> top just like a normal circle. Therefor I have to scale the original cone
> at the base with something like <1,1,0.5> and at the top with <1,1,1>,
> between these both position scaling like a linear function.
You can not. The matrix coefficients are constant, and only reversable
linear transforms are supported. To do otherwise would require tracing
curved rays, which is very, very slow.
> If there's no way to solve this problem with the matrix keyword,
> is there any other way to do?
You could use a generic polynomial shape or an isosurface. Or you could
just use the Supercone() macro in shapes.inc, which lets you specify an
ellipse for each end of a cone.
--
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/
Post a reply to this message
|
|
| |
| |
|
|
From: Warp
Subject: Re: matrix (components as functions of the coordinates)
Date: 13 Jun 2003 03:14:00
Message: <3ee979b8@news.povray.org>
|
|
|
| |
| |
|
|
Christopher James Huff <cja### [at] earthlinknet> wrote:
> You could use a generic polynomial shape or an isosurface. Or you could
> just use the Supercone() macro in shapes.inc
"You could use a polynomial... or you could use the Supercone() macro" as
if they were two different things is a bit misleading because the Supercone()
macro creates a polynomial. :)
Using the Supercone() macro is certainly the easiest way.
--
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
From: Warp
Subject: Re: matrix (components as functions of the coordinates)
Date: 13 Jun 2003 03:14:31
Message: <3ee979d7@news.povray.org>
|
|
|
| |
| |
|
|
How about using Supercone() in shapes.inc instead?-)
--
plane{-x+y,-1pigment{bozo color_map{[0rgb x][1rgb x+y]}turbulence 1}}
sphere{0,2pigment{rgbt 1}interior{media{emission 1density{spherical
density_map{[0rgb 0][.5rgb<1,.5>][1rgb 1]}turbulence.9}}}scale
<1,1,3>hollow}text{ttf"timrom""Warp".1,0translate<-1,-.1,2>}// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
From: Edwin Miller
Subject: Re: matrix (components as functions of the coordinates)
Date: 13 Jun 2003 04:50:46
Message: <3ee99065@news.povray.org>
|
|
|
| |
| |
|
|
Warp wrote:
> Christopher James Huff <cja### [at] earthlinknet> wrote:
>> You could use a generic polynomial shape or an isosurface. Or you could
>> just use the Supercone() macro in shapes.inc
>
> "You could use a polynomial... or you could use the Supercone() macro"
> as
> if they were two different things is a bit misleading because the
> Supercone() macro creates a polynomial. :)
>
> Using the Supercone() macro is certainly the easiest way.
>
Hi, many thanks for your hints (Supercone). It worked fine.
(Guess I have to read all of the Include-Files...;-)
But nevertheless it would be a great feature (in my opinion)
if POVRAY could do something like skaling an object as a function
of the coordinates ;-)
best regards
Edwin
Post a reply to this message
|
|
| |
| |
|
|
From: Warp
Subject: Re: matrix (components as functions of the coordinates)
Date: 13 Jun 2003 04:58:25
Message: <3ee99231@news.povray.org>
|
|
|
| |
| |
|
|
Edwin Miller <edw### [at] webde> wrote:
> But nevertheless it would be a great feature (in my opinion)
> if POVRAY could do something like skaling an object as a function
> of the coordinates ;-)
It certainly would be nice, but it's not possible because it's not
an affine transformation (even though it might look like it was).
Affine transformations are all those transformation which keep a
straight line straight after the transformation. If the line would be
bent after the transformation, that's just not possible. (And here I'm
talking naturally about the ray we are tracing.)
--
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -
Post a reply to this message
|
|
| |
| |
|
|
From: Edwin Miller
Subject: Re: matrix (components as functions of the coordinates)
Date: 13 Jun 2003 05:18:13
Message: <3ee996d4@news.povray.org>
|
|
|
| |
| |
|
|
Mike Williams wrote:
> Wasn't it Edwin Miller who wrote:
>
> ...
Hi Mike,
I've raytraced your isosurface and it worked fine. But it'll
take some time for me to understand what's going on ;-)
It seems that those isosurfaces are a powerful feature.
Many thanks,
Edwin
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
|
|