POV-Ray : Newsgroups : povray.general : Wrapping a HF around a Cylinder Server Time
7 Aug 2024 07:14:43 EDT (-0400)
  Wrapping a HF around a Cylinder (Message 1 to 4 of 4)  
From: Cris Williams
Subject: Wrapping a HF around a Cylinder
Date: 2 Nov 2001 11:32:07
Message: <3be2ca87@news.povray.org>
I seem to recall someone describing a way to wrap a heightfield around a
cylinder.  Does anyone else remember this, or was I just dreaming?

Cris Williams


Post a reply to this message

From: Christoph Hormann
Subject: Re: Wrapping a HF around a Cylinder
Date: 2 Nov 2001 12:10:08
Message: <3BE2D369.102908E2@gmx.de>
Cris Williams wrote:
> 
> I seem to recall someone describing a way to wrap a heightfield around a
> cylinder.  Does anyone else remember this, or was I just dreaming?

There's a HF_Cylinder macro in Povray 3.5 shapes.inc that generates a
mesh.  Apart from that you can also use an isosurface with an image
map/image_pattern function.

Christoph

-- 
Christoph Hormann <chr### [at] gmxde>
IsoWood include, radiosity tutorial, TransSkin and other 
things on: http://www.schunter.etc.tu-bs.de/~chris/


Post a reply to this message

From: Rune
Subject: Re: Wrapping a HF around a Cylinder
Date: 2 Nov 2001 14:24:54
Message: <3be2f306$1@news.povray.org>
"Cris Williams" wrote:
> I seem to recall someone describing a way to wrap a
> heightfield around a cylinder.  Does anyone else
> remember this, or was I just dreaming?

Technically you can't wrap a height_field object around a cylinder, but you
can create a mesh object that is just like it.

With POV-Ray 3.5 is an include file "shapes.inc" which has a macro to do
just that. (POV-Ray 3.5 is currently in the beta stage. You can download a
time-limited beta from www.povray.org for windows or mac.)

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

From: Mike Williams
Subject: Re: Wrapping a HF around a Cylinder
Date: 3 Nov 2001 07:53:44
Message: <DRAHLFAr+647Ew1C@econym.demon.co.uk>
Wasn't it Cris Williams who wrote:

>I seem to recall someone describing a way to wrap a heightfield around a
>cylinder.  Does anyone else remember this, or was I just dreaming?

You may not be able to wrap a height_field round a cylinder, but you can
wrap an image_map pigment around a cylinder (using map_type 2). In v3.5
any pigment can be used as an isosurface function, so we can combine the
cylindrical image_map function with a cylindrical isosurface.

Note: I've applied a scaling of y/pi to the HF function in this example,
so that a square heightfield image looks correctly proportioned when
stretched round a cylinder. Alternatively create a heightfield image
that is pi times wider than it is high.


camera { location  <0, 2, -6> look_at <0, 0, 0>}

light_source {<-100,200,-100> colour rgb 1}
light_source {<100,-200,-100> colour rgb 1}

// ----------------------------------------

#declare  Cyl = function {x^2 + z^2 -1}
#declare  HF  = function {pigment {image_pattern {jpeg "foo.jpg"
map_type 2 interpolate 2}}}

#declare F=function{Cyl(x,0,z) - HF(x,y/pi,z).grey} // See Note

isosurface {
  function { F(x,y,z) }
        max_gradient 20
        contained_by{box{-1.5,1.5}}
        pigment {rgb 1}
}


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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