Article 21339 of comp.graphics.rendering.renderman: Path: sn-us!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!novia!novia!nntp3.cerf.net!sherman.pixar.com!not-for-mail From: Daniel McCoy Newsgroups: comp.graphics.rendering.renderman Subject: Re: Hermite patch Date: Wed, 16 Jan 2002 23:31:04 -0800 Organization: Pixar Lines: 90 Message-ID: <3C467DB8.751BB114@pixar.com> References: <1011172287.941046@ruski.enuff.com> NNTP-Posting-Host: moomin.pixar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sherman.pixar.com 1011252663 16201 138.72.27.160 (17 Jan 2002 07:31:03 GMT) X-Complaints-To: abuse@pixar.com NNTP-Posting-Date: 17 Jan 2002 07:31:03 GMT X-Mailer: Mozilla 4.77 [en] (X11; U; IRIX64 6.5 IP30) X-Accept-Language: en Xref: sn-us comp.graphics.rendering.renderman:21339 Nicholas Yue wrote: > > I am attempting to represent a hermite patch, how should I layout the > splines that makes up a hermite patch. The spec says to lay it out as Point0 > Vector0 Point1 and Vector1 but I didn't see any mention of layout the rest > of the spline. > > My attempts have failed to produce what I am expecting of a hermite/coons > patch. > > Does anyone have an example ? Yeah, the spec is a little terse on the subject of the Hermite basis. What it's trying to tell you is that the RenderMan "hermite" basis is different from the classic Hermite basis you'll find in the literature. The difference being that the RenderMan version is better adapted to patchmeshes. The layout of a "classical" Hermite patch is like so: p00 p01 du00 du01 p10 p11 du10 du11 dv00 dv01 tw00 tw01 dv10 dv11 tw10 tw11 The "p" values are the points, "du" the vectors in the u direction, "dv" the vectors in the v direction, and "tw" are the cross derivatives or "twist" vectors that few folks know how to visualize. This layout puts all the points in one 2x2 section and the vectors each in their own 2x2 section so that it's impossible to create a mesh of them without making the stepsize four and duplicating a lot of information. If you want to use this layout you can set the basis yourself: Basis [2 -2 1 1 -3 3 -2 -1 0 0 1 0 1 0 0 0] 4 [2 -2 1 1 -3 3 -2 -1 0 0 1 0 1 0 0 0] 4 (Though I'm not sure that patchmeshes will work in the current prman with that basis. I just tried one and I'm sending in a bug report on it. Single patches are fine though.) The layout of a RenderMan Hermite patch is like so: p00 du00 p01 du01 dv00 tw00 dv01 tw01 p10 du10 p11 du11 dv10 tw10 dv11 tw11 Each little 2x2 section defines a single point and the slopes coming out of the point, hence the stepsize on the basis is 2 and you can chain them into a patchmesh compactly. Here's some single patch hermite examples: Basis "hermite" 2 "hermite" 2 # Hermite patch that makes an egg carton shape using # the edge vectors Patch "bicubic" "P" [ -1.0 -1.0 0.0 2.0 0.0 5.0 1.0 -1.0 0.0 2.0 0.0 5.0 0.0 2.0 5.0 0.0 0.0 0.0 0.0 2.0 -5.0 0.0 0.0 0.0 -1.0 1.0 0.0 2.0 0.0 -5.0 1.0 1.0 0.0 2.0 0.0 -5.0 0.0 2.0 5.0 0.0 0.0 0.0 0.0 2.0 -5.0 0.0 0.0 0.0] # Hermite patch with straight sides that bulges out in the +z direction Patch "bicubic" "P" [ -1.0 -1.0 0.0 2.0 0.0 0.0 1.0 -1.0 0.0 2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 20.0 0.0 2.0 0.0 0.0 0.0 -20.0 -1.0 1.0 0.0 2.0 0.0 0.0 1.0 1.0 0.0 2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 -20.0 0.0 2.0 0.0 0.0 0.0 20.0] # Hermite patch with straight sides that creates an egg carton shape Patch "bicubic" "P" [ -1.0 -1.0 0.0 2.0 0.0 0.0 1.0 -1.0 0.0 2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 100.0 0.0 2.0 0.0 0.0 0.0 100.0 -1.0 1.0 0.0 2.0 0.0 0.0 1.0 1.0 0.0 2.0 0.0 0.0 0.0 2.0 0.0 0.0 0.0 100.0 0.0 2.0 0.0 0.0 0.0 100.0] Here's a Hermite patchmesh example: Basis "hermite" 2 "hermite" 2 # Mesh that creates a larger egg carton by inflecting the edges PatchMesh "bicubic" 6 "nonperiodic" 6 "nonperiodic" "P" [ -1 -1 0 1 0 3 0 -1 0 1 0 3 1 -1 0 1 0 3 0 1 -3 0 0 0 0 1 -3 0 0 0 0 1 -3 0 0 0 -1 0 0 1 0 3 0 0 0 1 0 3 1 0 0 1 0 3 0 1 -3 0 0 0 0 1 -3 0 0 0 0 1 -3 0 0 0 -1 1 0 1 0 3 0 1 0 1 0 3 1 1 0 1 0 3 0 1 -3 0 0 0 0 1 -3 0 0 0 0 1 -3 0 0 0] Hope that helps. Daniel "Hermite" McCoy Pixar