POV-Ray : Newsgroups : povray.newusers : General transformation of an object Server Time
1 Nov 2024 08:12:45 EDT (-0400)
  General transformation of an object (Message 1 to 7 of 7)  
From: houmr
Subject: General transformation of an object
Date: 30 Oct 2009 12:05:01
Message: <web.4aeb0d65636728607fab4e430@news.povray.org>
Hi! Is it possible to make a genetral transformation of an object in Povray in
the way that I assign a new values (x',y',z') to the existing x,y,z coordinates
of the object, according to some rule? E.g. I have the following: x'=x; y'=
y+0.8*z*(y*z)/(300-z); z'=0.8*z . I was trying to play around with matrix, but
it doesn't seem to be the way.


Post a reply to this message

From: clipka
Subject: Re: General transformation of an object
Date: 30 Oct 2009 12:59:05
Message: <4aeb1b59$1@news.povray.org>
houmr schrieb:

> Hi! Is it possible to make a genetral transformation of an object in Povray in
> the way that I assign a new values (x',y',z') to the existing x,y,z coordinates
> of the object, according to some rule? E.g. I have the following: x'=x; y'=
> y+0.8*z*(y*z)/(300-z); z'=0.8*z . I was trying to play around with matrix, but
> it doesn't seem to be the way.

No, POV-Ray only supports affine transformations, i.e. any 
transformations where each new coordinate is some linear combination of 
the original coordinates and some constant.

Some people have experimented with "slicing" the object to be 
transformed, and transforming each slice with a different matrix. 
Another approach would be to convert the object to an isosurface (much 
work has been done in this direction recently), and then use that to 
define another arbitrarily-transformed variant of the object.


Post a reply to this message

From: Mike Williams
Subject: Re: General transformation of an object
Date: 30 Oct 2009 16:16:17
Message: <AgzCGfCck06KFwBM@econym.demon.co.uk>
Wasn't it houmr who wrote:
>Hi! Is it possible to make a genetral transformation of an object in Povray in
>the way that I assign a new values (x',y',z') to the existing x,y,z coordinates
>of the object, according to some rule? E.g. I have the following: x'=x; y'=
>y+0.8*z*(y*z)/(300-z); z'=0.8*z . I was trying to play around with matrix, but
>it doesn't seem to be the way.

You can't perform non-linear transformations on general POV objects, but 
if you can express your object as an isosurface function you can perform 
non-linear variable substitution on that function.

http://www.econym.demon.co.uk/isotut/substitute.htm#nls

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Leroy Whetstone
Subject: Re: General transformation of an object
Date: 1 Nov 2009 23:48:54
Message: <4AEE650C.1080209@joplin.com>
houmr wrote:
> Hi! Is it possible to make a genetral transformation of an object in Povray in
> the way that I assign a new values (x',y',z') to the existing x,y,z coordinates
> of the object, according to some rule? E.g. I have the following: x'=x; y'=
> y+0.8*z*(y*z)/(300-z); z'=0.8*z . I was trying to play around with matrix, but
> it doesn't seem to be the way.

What are you trying to do with this? There maybe other things you could do
other than use 'matrix'. You might be able to use a macro to deform and 
then place your object.


Post a reply to this message

From: houmr
Subject: Re: General transformation of an object
Date: 2 Nov 2009 06:45:01
Message: <web.4aeec54aeee70a117fab4e430@news.povray.org>
Leroy Whetstone <lrw### [at] joplincom> wrote:

> What are you trying to do with this? There maybe other things you could do
> other than use 'matrix'. You might be able to use a macro to deform and
> then place your object.

In fact the result of the transformation is kind of uneven shearing. The shear
is along the y axis, but the value is proportional to the y coordinate. (If you
imagine a cube, the angle formed by upper side and the z axis is about twice of
the angle formed by the bottom side and the z axis. So the sheared box becomes
wider on one side and narrower on the other side. All the faces remain planar).
I need to use this transformation to compensate a distortion involved by an
optical system while projecting the rendered images. Since the models are of
arbitrary and real sceneries, I doubt being able to convert it to isosurfaces.


Post a reply to this message

From: clipka
Subject: Re: General transformation of an object
Date: 2 Nov 2009 07:38:32
Message: <4aeed2c8$1@news.povray.org>
houmr schrieb:

> In fact the result of the transformation is kind of uneven shearing. The shear
> is along the y axis, but the value is proportional to the y coordinate. (If you
> imagine a cube, the angle formed by upper side and the z axis is about twice of
> the angle formed by the bottom side and the z axis. So the sheared box becomes
> wider on one side and narrower on the other side. All the faces remain planar).
> I need to use this transformation to compensate a distortion involved by an
> optical system while projecting the rendered images. Since the models are of
> arbitrary and real sceneries, I doubt being able to convert it to isosurfaces.

If the faces really remain planar, you can create the desiered shape 
using...

(a) an intersection of planes (Warning: Does not bound properly!)

(b) an intersection of well-sized boxes

(c) a prism object

...

to name just the first three ideas that cross my mind.


Post a reply to this message

From: Chris B
Subject: Re: General transformation of an object
Date: 2 Nov 2009 08:44:16
Message: <4aeee230$1@news.povray.org>
"houmr" <nomail@nomail> wrote in message 
news:web.4aeec54aeee70a117fab4e430@news.povray.org...
> Leroy Whetstone <lrw### [at] joplincom> wrote:
>
>> What are you trying to do with this? There maybe other things you could 
>> do
>> other than use 'matrix'. ...
>
> In fact the result of the transformation is kind of uneven shearing...
> I need to use this transformation to compensate a distortion involved by 
> an
> optical system while projecting the rendered images. Since the models are 
> of
> arbitrary and real sceneries, I doubt being able to convert it to 
> isosurfaces.
>

If it's to address real-world projection issues then it may be possible to 
do what you want in two passes:

Pass 1 - Render the scene as normal (or use a scanned photo).
Pass 2 - Apply the image to a surface within a scene that emulates the 
physical screen, projector and potentially any strange optics. The camera or 
cameras can be positioned where the projector would be in the equivalent 
real-world environment, using appropriate lens settings so that you get 
images that are appropriately distorted.

I recall that someone was using this sort of technique a few years back to 
adjust images projected from 4 projectors onto a cylindrical screen so that 
they could mesh the images together correctly into a full 360 degree image.

Regards,
Chris B.


Post a reply to this message

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