POV-Ray : Newsgroups : povray.general : transformations Server Time
4 Aug 2024 10:18:02 EDT (-0400)
  transformations (Message 1 to 4 of 4)  
From: Bill Hails
Subject: transformations
Date: 17 May 2003 12:53:39
Message: <3ec66913@news.povray.org>
Hi
I guess this is more of a wish than a question, but I'm consistently
and pleasantly surprised by your answers :-)

What I'd like is to be able to apply arbitrary transformations to
vector expressions and get vector expressions back.

The problem is, with something like an articulated robot arm, I want to
have pneumatic cylinders that run from one joint to another, where the
other joint has had an arbitrary transform{} applied. If I could apply
the same transform{} to a vector identifying the point on the un-transformed
object I could use that as the target for the other end of the cylinder.

-------

<Wish>
On a closely related note, is anyone familiar with constraint
resolution systems, like the one implemented in Metafont?
And has anyone thought of adding such a constraint
resolution system to POV-Ray?

In Metafont you can say things like

        transform T;    % declare T as an unknown transformation
        % z1 z2 etc are known points (vectors)
        z1 transformed T = z2;
        z3 transformed T = z4;
        z5 transformed T = z6;

and after enough such constraints have been specified, T can be
used to transform other points. (Metafont only has 2 dimensions
to worry about of course).

The really cool thing about Metafont is that its variables are
variables in the mathematical sense: they take on a value only
when enough is known about them, so it's quite alright to say

        z1 = 1/2[z2, z3];       % z1 is half way between z2 and z3
        z2 = (1, 1);
        z3 = (3, 5);

Where none of the variables previously had values, and after which
z1 magically has the value (2, 3).
</Wish>

Well, I can dream :-)

-- 
Bill Hails


Post a reply to this message

From: Bill Hails
Subject: Re: transformations
Date: 17 May 2003 13:32:30
Message: <3ec6722e@news.povray.org>
I wrote before thinking about it:

> Hi
> I guess this is more of a wish than a question, but I'm consistently
> and pleasantly surprised by your answers :-)
> 
> What I'd like is to be able to apply arbitrary transformations to
> vector expressions and get vector expressions back.
> 

Just after posting this I thought of an easy way to do it:

#macro transform_vector(V, T)
    #local S = sphere { V, 1 transform T }
    #local Min = min_extent(S);
    #local Max = max_extent(S);
    ((Min + Max) / 2)
#end

-- 
Bill Hails


Post a reply to this message

From: Warp
Subject: Re: transformations
Date: 17 May 2003 14:11:13
Message: <3ec67b40@news.povray.org>
Bill Hails <bil### [at] europeyahoo-inccom> wrote:
> #macro transform_vector(V, T)
>     #local S = sphere { V, 1 transform T }
>     #local Min = min_extent(S);
>     #local Max = max_extent(S);
>     ((Min + Max) / 2)
> #end

  How about using vtransform() from transforms.inc instead?

-- 
#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: Bill Hails
Subject: Re: transformations
Date: 17 May 2003 14:37:50
Message: <3ec6817e@news.povray.org>
Warp wrote:

> Bill Hails <bil### [at] europeyahoo-inccom> wrote:
>> #macro transform_vector(V, T)
>>     #local S = sphere { V, 1 transform T }
>>     #local Min = min_extent(S);
>>     #local Max = max_extent(S);
>>     ((Min + Max) / 2)
>> #end
> 
>   How about using vtransform() from transforms.inc instead?
> 

Ah, I didn't know about that one. I did check out the doc for
transforms.inc before I posted, I must have missed it, thanks!

-- 
Bill Hails


Post a reply to this message

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