POV-Ray : Newsgroups : povray.newusers : How can I distort a cube? Server Time
4 Nov 2024 13:03:42 EST (-0500)
  How can I distort a cube? (Message 1 to 6 of 6)  
From: Kaveh
Subject: How can I distort a cube?
Date: 6 Mar 2003 08:01:31
Message: <1frehcv.jpygmt1hkz557N%kaveh@delete_this.focalimage.com>
Suppose I have a perfect cube, which is then distorted. I can define the
distortion by giving the coordinates of the corners, the midpoints of
the edges, and the centers of the faces. How can I draw this new shape,
with smooth faces going through the points? 

I have looked at mesh2, but there you have to define the control points.
I don't know the control points, but just the points the surfaces must
intersect. 

Thanks in advance for any pointers.

-- 
Kaveh


Post a reply to this message

From: Micha Riser
Subject: Re: How can I distort a cube?
Date: 6 Mar 2003 08:27:32
Message: <3e674cc3@news.povray.org>
Kaveh wrote:

> Suppose I have a perfect cube, which is then distorted. I can define the
> distortion by giving the coordinates of the corners, the midpoints of
> the edges, and the centers of the faces. How can I draw this new shape,
> with smooth faces going through the points?
> 

You could use bicubic patches with 1 or 4 patches per side (see section 
3.4.5). If you use 4 of them you can easily fullfill the point 
interpolation criterion but you have some freedom left in the control 
points. If you use olny 1 per side it gets difficult to have the patch 
interpolate the midpoints and center points.

But all the same bicubic patches might be the right thing to chose.

- Micha

-- 
POV-Ray Objects Collection: http://objects.povworld.org


Post a reply to this message

From: ABX
Subject: Re: How can I distort a cube?
Date: 6 Mar 2003 08:42:33
Message: <pmje6vo4kc92to4n64qf5frg2k5lc4lklv@4ax.com>
On Thu, 6 Mar 2003 13:01:32 +0000, kav### [at] delete_thisfocalimagecom (Kaveh)
wrote:
> Suppose I have a perfect cube, which is then distorted. I can define the
> distortion by giving the coordinates of the corners, the midpoints of
> the edges, and the centers of the faces. How can I draw this new shape,
> with smooth faces going through the points? 

This can be done with bicubic patches as Micha Riser suggested. But there
are other soultions. For some distortions you can use isosurfaces. Just have
to define function of distortion. It is rather complicated and possible only
for "function expressable" deformations (is this acceptable term?). If you
can define your edges as splines you can use macro to fill area enclosed in
splines - take a look at MMMM macros by Ingo
http://members.home.nl/seedseven/

ABX


Post a reply to this message

From: Kaveh
Subject: Re: How can I distort a cube?
Date: 7 Mar 2003 10:41:46
Message: <1frgjef.ubpfxvybgt50N%kaveh@delete_this.focalimage.com>
Micha Riser <mri### [at] gmxnet> wrote:

> Kaveh wrote:
> 
> > Suppose I have a perfect cube, which is then distorted. I can define the
> > distortion by giving the coordinates of the corners, the midpoints of
> > the edges, and the centers of the faces. How can I draw this new shape,
> > with smooth faces going through the points?
> > 
> 
> You could use bicubic patches with 1 or 4 patches per side (see section
> 3.4.5). If you use 4 of them you can easily fullfill the point 
> interpolation criterion but you have some freedom left in the control
> points. If you use olny 1 per side it gets difficult to have the patch
> interpolate the midpoints and center points.
> 
> But all the same bicubic patches might be the right thing to chose.

Thanks Micha. Look like 4 patches is the right way to go. But a question
here:

- Seems I have to define all pionts, including control points, when the
shapes distort. What I want is to give the changes for the corner
points, which the patch must go through, and let the control points be
chosen automatically so as to create a smooth shape. Is this possible?
If not, how can I calculate those control points?

-- 
Kaveh


Post a reply to this message

From: Warp
Subject: Re: How can I distort a cube?
Date: 7 Mar 2003 20:21:56
Message: <3e6945b3@news.povray.org>
Kaveh <kav### [at] delete_thisfocalimagecom> wrote:
> - Seems I have to define all pionts, including control points, when the
> shapes distort. What I want is to give the changes for the corner
> points, which the patch must go through, and let the control points be
> chosen automatically so as to create a smooth shape. Is this possible?
> If not, how can I calculate those control points?

  There's a tutorial in the POV-Ray documentation about how to join
two patches together seamlessly. This happens by arranging the control
points in the right way (which can be done mathematically).
  You should be able to create the control points with a little work.

-- 
#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: Kaveh
Subject: Re: How can I distort a cube?
Date: 8 Mar 2003 04:39:22
Message: <1frhxf3.w8h514ep0hs5N%kaveh@delete_this.focalimage.com>
Warp <war### [at] tagpovrayorg> wrote:

> Kaveh <kav### [at] delete_thisfocalimagecom> wrote:
> > - Seems I have to define all pionts, including control points, when the
> > shapes distort. What I want is to give the changes for the corner
> > points, which the patch must go through, and let the control points be
> > chosen automatically so as to create a smooth shape. Is this possible?
> > If not, how can I calculate those control points?
> 
>   There's a tutorial in the POV-Ray documentation about how to join
> two patches together seamlessly. This happens by arranging the control
> points in the right way (which can be done mathematically).
>   You should be able to create the control points with a little work.

I just discovered "multispline.inc" on a tutorial page by Josh:

http://www.spiritone.com/~english/cyclopedia/patches.html

Seems to do exactly this, i.e. to find control points from corner
points. Going through it now. Thanks.

-- 
Kaveh


Post a reply to this message

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