POV-Ray : Newsgroups : povray.general : Contigous height_fields and round corners. Server Time
18 Nov 2024 09:12:37 EST (-0500)
  Contigous height_fields and round corners. (Message 1 to 4 of 4)  
From: JRG
Subject: Contigous height_fields and round corners.
Date: 8 Sep 2002 12:50:24
Message: <3d7b7fd0@news.povray.org>
I have two height_fields and I want them to create a round corner instead of a sharp
one. I thought about cutting the height_fields (which come from a seamless bitmap)
and rotating these thin "slices" around the y axis... but maybe there are more
efficient ways to accomplish this (hmm... displacing an iso cylinder?).
Any help or idea would be very appreciated.

Thanks in advance,

--
Jonathan.


Post a reply to this message

From: Gilles Tran
Subject: Re: Contigous height_fields and round corners.
Date: 8 Sep 2002 13:05:37
Message: <3d7b8361@news.povray.org>

3d7b7fd0@news.povray.org...
> I have two height_fields and I want them to create a round corner instead
of a sharp
> one. I thought about cutting the height_fields (which come from a seamless
bitmap)
> and rotating these thin "slices" around the y axis... but maybe there are
more
> efficient ways to accomplish this (hmm... displacing an iso cylinder?).

I used the slicing method once for my IRTC "fortress" image. The height
field I used were rough so that I didn't have to use many slices (I think 3
to 5 did the trick). Note that I was folding one HF in 2,  not joining two
of them but since you're using a seamless bitmap it should be the same
technique.
Oh well the macro's here:

#macro mHFCorner(HF,xHF,yHF,zHF,rCorner,nCorner)
    // the HF must be already textured and vertical
    // it must have been translated before to be in the positive z
    // xHF = width of front pane (x, 0 -> xHF)
    // yHF = height of side pane (y, 0 -> yHF)
    // zHF = depth of side pane (z, 0 -> zHF)
    // rCorner = radius of corner
    // nCorner = number of corner elements

    #local lHF=xHF+zHF+rCorner*(-2+pi/2);
    #local HF=object{HF scale <lHF,yHF,1>}
    #local iCorner=(rCorner*pi/2)/nCorner;
    #local i=0;
    union{
        object{HF clipped_by{plane{x,xHF-rCorner}}}
        #while (i<nCorner)
            object{HF clipped_by{box{<0,-0.1,-1.1>,<iCorner,yHF*1.1,1.1>
translate x*(xHF-rCorner+i*iCorner)}}
                translate -x*(xHF-rCorner+(i+0.5)*iCorner)
                translate z*-rCorner
                rotate -y*(i*90/nCorner+45/nCorner)
                translate z*rCorner+x*(xHF-rCorner)
            }
            #local i=i+1;
        #end
        object{HF clipped_by{plane{x,lHF-zHF+rCorner inverse}}
translate -x*(lHF-rCorner-zHF) rotate y*-90 translate <xHF,0,-rCorner>} //
pigment{Cyan}}
    }
#end


G.


--
**********************
http://www.oyonale.com
**********************
- Graphic experiments
- POV-Ray and Poser computer images
- Posters


Post a reply to this message

From: JRG
Subject: Re: Contigous height_fields and round corners.
Date: 8 Sep 2002 13:17:56
Message: <3d7b8644@news.povray.org>
"Gilles Tran" wrote:
> I used the slicing method once for my IRTC "fortress" image. The height
> field I used were rough so that I didn't have to use many slices (I think 3
> to 5 did the trick). Note that I was folding one HF in 2,  not joining two
> of them but since you're using a seamless bitmap it should be the same
> technique.
> Oh well the macro's here:

Wow. This macro comes unexpected like Manna from God!
I'm going to try it now.
Thanks.

--
Jonathan.


Post a reply to this message

From: Shay
Subject: Re: Contigous height_fields and round corners.
Date: 9 Sep 2002 11:00:17
Message: <3d7cb781@news.povray.org>
Just make a mesh in the shape you want and then move each vertex in your
mesh along its normal an amount determined by the y components of the hf
vertices. Write the whole thing out to an include file, and then never wait
for that parse again.

 -Shay

JRG <jrg### [at] hotmailcom> wrote in message news:3d7b7fd0@news.povray.org...


Post a reply to this message

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