POV-Ray : Newsgroups : povray.advanced-users : Bicubic patch macro Server Time
29 Jul 2024 18:23:00 EDT (-0400)
  Bicubic patch macro (Message 11 to 15 of 15)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Rune
Subject: Re: Bicubic patch macro
Date: 10 Feb 2002 20:12:23
Message: <3c671a77@news.povray.org>
"bob h" wrote:
> Hmmm, if Dave hadn't pointed his files out I would have.
> Sounded just like the thing you were asking to me too.
> Creates a bicubic_patch by macro and places wireframe for it.

A bicubic patch AKA a bezier patch is a mathematically defined surface that
is used in many other programs than POV-Ray.

I wanted to create a bicubic patch surface using a *mesh*, not using the
build-in bicubic patch object in POV-Ray. This is because I wanted to know
how bicubic patches work at a low level.

That's what I meant and that's what I wrote, but I could have made it more
clear I guess.

Anyway, thanks for your good intentions Dave an Bob!

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


Post a reply to this message

From: Ron Parker
Subject: Re: Bicubic patch macro
Date: 10 Feb 2002 21:04:05
Message: <slrna6e9kp.igb.ron.parker@fwi.com>
On Mon, 11 Feb 2002 02:12:26 +0100, Rune wrote:
> I wanted to create a bicubic patch surface using a *mesh*, not using the
> build-in bicubic patch object in POV-Ray. This is because I wanted to know
> how bicubic patches work at a low level.

As you know, one of the methods that already exists for bicubic patches 
turns them into meshes, so you could look at the source code for POV 
itself to see how this is done.

--
#macro R(L P)sphere{L __}cylinder{L P __}#end#macro P(_1)union{R(z+_ z)R(-z _-z)
R(_-z*3_+z)torus{1__ clipped_by{plane{_ 0}}}translate z+_1}#end#macro S(_)9-(_1-
_)*(_1-_)#end#macro Z(_1 _ __)union{P(_)P(-_)R(y-z-1_)translate.1*_1-y*8pigment{
rgb<S(7)S(5)S(3)>}}#if(_1)Z(_1-__,_,__)#end#end Z(10x*-2,.2)camera{rotate x*90}


Post a reply to this message

From: Chris Colefax
Subject: Re: Bicubic patch macro
Date: 11 Feb 2002 03:44:41
Message: <3c678479@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   Colefax's PCM macros can place objects on the surface of a bicubic
patch.
> Thus it should be rather easy to adapt it to calculate vertex point on the
> surface of the bicubic patch.

Funnily enough, the pcm.mcr file contains a macro called
PCM_get_patch_point, that takes an array of 16 bezier-patch control points
and a U, V coordinate, and returns a point on the patch's surface
accordingly.  There's also a macro that will convert the control points into
a grid of surface points of arbitrary resolution, and (of course!) the
source for all these calculations is freely available.


Post a reply to this message

From: Rune
Subject: Re: Bicubic patch macro
Date: 11 Feb 2002 04:57:53
Message: <3c6795a1@news.povray.org>
"Ron Parker" wrote:
> As you know, one of the methods that already exists
> for bicubic patches turns them into meshes

Yes I know.

> so you could look at the source code for POV
> itself to see how this is done.

Not very easy when I don't know C I imagine and for that same reason I don't
have the source code lying around. Is it generally simple enough to learn
from the source code even though you don't know C (or C++ for that matter)?

Anyway, as mentioned, I found some other ways to learn about it.

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


Post a reply to this message

From: Josh English
Subject: Re: Bicubic patch macro
Date: 22 Feb 2002 14:44:13
Message: <3C769F8B.5722DFE1@spiritone.com>
Take a look at 

http://www.spiritone.com/~english/cyclopedia/patches.html

With my experiences here it seems that it uses the 16 control points and
calculates mesh positions along 8 different bezier splines. 

Josh English
eng### [at] spiritonecom
http://www.spiritone.com/~english


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

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