POV-Ray : Newsgroups : povray.newusers : looking for an object-type with four corners Server Time
28 Jun 2024 06:37:56 EDT (-0400)
  looking for an object-type with four corners (Message 1 to 6 of 6)  
From: folkert
Subject: looking for an object-type with four corners
Date: 22 Jul 2011 15:05:01
Message: <web.4e29c95025ffac84e70ca0910@news.povray.org>
Hi,

I'm looking for an object-type with four corners. One could think of a square
but not with all corners in the same plane.
Any suggestions?
Thanks in advance.


Post a reply to this message

From: Warp
Subject: Re: looking for an object-type with four corners
Date: 22 Jul 2011 15:34:22
Message: <4e29d0be@news.povray.org>
folkert <fol### [at] vanheusdencom> wrote:
> I'm looking for an object-type with four corners. One could think of a square
> but not with all corners in the same plane.
> Any suggestions?

  bicubic_patch.

-- 
                                                          - Warp


Post a reply to this message

From: folkert
Subject: Re: looking for an object-type with four corners
Date: 22 Jul 2011 15:50:00
Message: <web.4e29d33d534cf3cde70ca0910@news.povray.org>
> > I'm looking for an object-type with four corners. One could think of a square
> > but not with all corners in the same plane.
> > Any suggestions?
>
>   bicubic_patch.

That looks indeed usable.
Any hints how I convert a 4-point square into the 16 points of a bicubic_patch?


Post a reply to this message

From: folkert
Subject: Re: looking for an object-type with four corners
Date: 22 Jul 2011 16:00:01
Message: <web.4e29d638534cf3cde70ca0910@news.povray.org>
"folkert" <fol### [at] vanheusdencom> wrote:
> > > I'm looking for an object-type with four corners. One could think of a square
> > > but not with all corners in the same plane.
> > > Any suggestions?
> >
> >   bicubic_patch.
>
> That looks indeed usable.
> Any hints how I convert a 4-point square into the 16 points of a bicubic_patch?

I was thinking of:


// square:
// x1y1   x2y2
// x4y4   x3y3

xm1 = ((x2 - x1) / 4) * xstep + x1
ym1 = ((y2 - y1) / 4) * ystep + y1
xm2 = ((x3 - x4) / 4) * xstep + x4
ym2 = ((y3 - y4) / 4) * ystep + y4
x = (xm1 * (3 - xstep) + xm2 * xstep) / 4
y = (ym1 * (3 - ystep) + ym2 * ystep) / 4

and then run xstep from 0 to 3 and same for ystep but i'm not entirely sure


Post a reply to this message

From: folkert
Subject: Re: looking for an object-type with four corners
Date: 22 Jul 2011 17:30:01
Message: <web.4e29eb55534cf3cde70ca0910@news.povray.org>
for(ystep=0; ystep<4; ystep++)
 {
  for(xstep=0; xstep<4; xstep++)
  {
   double u=xstep/3.0;
   double v=ystep/3.0;
   double x=(x1*(1-v)+x4*v)*(1-u)+(x2*(1-v)+x3*v)*u;
   double y=(y1*(1-v)+y4*v)*(1-u)+(y2*(1-v)+y3*v)*u;
   double z=(z2*(1-v)+z4*v)*(1-u)+(z2*(1-v)+z3*v)*u;
   printf("%f,%f,%f\t", x, y, z);
  }
  printf("\n");
 }


Post a reply to this message

From: Christian Froeschlin
Subject: Re: looking for an object-type with four corners
Date: 22 Jul 2011 20:01:58
Message: <4e2a0f76$1@news.povray.org>
folkert wrote:

> Any hints how I convert a 4-point square into the 16 points of a bicubic_patch?

4 points do not uniquely define a "quadrangle" in 3d space,
so you need to be a bit clearer on the shape of the object
you wish to produce. The simplest way is two triangles with
a sharp edge but even then there are two ways of splitting
that yield a different shape.


Post a reply to this message

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