POV-Ray : Newsgroups : povray.general : image_map with bicubic patches Server Time
5 Nov 2024 09:23:32 EST (-0500)
  image_map with bicubic patches (Message 1 to 3 of 3)  
From: mathfan
Subject: image_map with bicubic patches
Date: 18 Apr 2003 03:30:04
Message: <web.3e9fa89bec45937d30e3295f0@news.povray.org>
I'm currently working on a scene that contains several bicubic pathces. I've
tried to use an image_map on them, but the image seems strangely stretched
in some places while it's fine in other places.
Is there something I can do about this?

thanx


Post a reply to this message

From: Peter Kryszkiewicz
Subject: Re: image_map with bicubic patches
Date: 18 Apr 2003 13:19:49
Message: <3ea033b5@news.povray.org>
"mathfan" <iva### [at] c2inet> wrote in message
news:web.3e9fa89bec45937d30e3295f0@news.povray.org...
> I'm currently working on a scene that contains several bicubic pathces.
I've
> tried to use an image_map on them, but the image seems strangely stretched
> in some places while it's fine in other places.
> Is there something I can do about this?
>
> thanx
>
I just happened to have built what you described just yesterday. Here's what
I found;

1.  I modified the bicubic patch sample in the POV Help docs so that it had
the same orientation as an image map (the XY plane from 0,0 to 1,1). I also
made it absolutely flat, so I could see the effects of the image mapping.

#declare B11=<0,0,0>; #declare B12=<1,0,0>; //
#declare B13=<2,0,0>; #declare B14=<3,0,0>; // row 1

#declare B21=<0,1,0>; #declare B22=<1,1,0>; //
#declare B23=<2,1,0>; #declare B24=<3,1,0>; // row 2

#declare B31=<0,2,0>; #declare B32=<1,2,0>; //
#declare B33=<2,2,0>; #declare B34=<3,2,0>; // row 3

#declare B41=<0,3,0>; #declare B42=<1,3,0>; //
#declare B43=<2,3,0>; #declare B44=<3,3,0>; // row 4



2. The bicubic sample is bigger by 3 so I scaled the image map by 3. I also
made sure the aspect ratio of the original image was factored into the final
scaling at the object stage.

3. The patch forms the basis for memos on a bulletin board in my virtual
office (see http://www.worldwins.net/~peter/images/wwins-notes.jpg )
Here's the code for the  memos;
//--------------------------------------------------------------
#declare memo = bicubic_patch {
  type 1
   flatness 0.8 // flatness value   0-1
  //       flatness_value = 0.0 to 1.0, with higher = flatter
  u_steps 3 // # of triangles to subdivide (1-5)
  v_steps 3 // # of triangles to subdivide (1-5)
   uv_vectors
   <0,0> <1,0> <1,1> <0,1>
   B11, B12, B13, B14
   B21, B22, B23, B24
   B31, B32, B33, B34
   B41, B42, B43, B44
 texture {notepage scale 3 }    // to match the patch
 translate <-1.5, -1.5, 0> // center the patch on origin to make further
transformations easier to predict.
}

object {memo  scale <8.5, 11, 1>} // aspect ratio factored in for
letter-size memos
//---------------------------------------------------------------

I added a bit of page curl to the memos to make them look more natural

Hope this is clear enough


Post a reply to this message

From: Warp
Subject: Re: image_map with bicubic patches
Date: 18 Apr 2003 14:08:00
Message: <3ea03f00@news.povray.org>
mathfan <iva### [at] c2inet> wrote:
> I'm currently working on a scene that contains several bicubic pathces. I've
> tried to use an image_map on them, but the image seems strangely stretched
> in some places while it's fine in other places.
> Is there something I can do about this?

  Is UV-mapping the feature you are searching for?

-- 
#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

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