POV-Ray : Newsgroups : povray.advanced-users : How to use a bezier-curve (2D) for a function to use in a texture? Server Time
28 Jul 2024 14:18:29 EDT (-0400)
  How to use a bezier-curve (2D) for a function to use in a texture? (Message 1 to 4 of 4)  
From: D  H  Berlin
Subject: How to use a bezier-curve (2D) for a function to use in a texture?
Date: 11 Sep 2004 00:35:01
Message: <web.41427fd3c601232d88e4a61c0@news.povray.org>
Hi!

I don't have to much knowledge about the math I need. So I hope my
explanation what I want to achieve is right.

I want to use a curve-function (f.e. a cubic-bezier) which is defined
through points laying in the x,y-plane (2D-curve) in a function for a
texture. Where the curve runs, the function should give back 1 and it
should have a fallof described through a factor f (fallof maybe like when
using an airbrush) so the function gives back 0 when the texture-point to
be calculated is away  f.e. 0.01 povray-units.

If 1 povray-unit would be 1 meter, this function should draw a texture which
would be a line defined by the points of the bezier-curve and a fallof to 0
in a distance of 0.01 units to both side of the curve.

The goal would be, that one could just draw text using a bezier-curve for a
letter in a program, export the points, and by just putting the point-list
in to the povray-function could use the drawn-text as texture.

I hope it's not do difficult.

Greetings
Dieter


Post a reply to this message

From: David Wallace
Subject: Re: How to use a bezier-curve (2D) for a function to use in a texture?
Date: 13 Sep 2004 21:51:55
Message: <41464ebb$1@news.povray.org>
I want that function, too, but for a different purpose.  If I could
calculate the distance from a 2D-point in space to the nearest point on a
bezier spline,  I would be drawing rivers and streams in landscapes.  I
suspect the math would be rather egregious, though.

"D. H. Berlin" <wee### [at] PoVStefaniede> wrote in message
news:web.41427fd3c601232d88e4a61c0@news.povray.org...
> Hi!
>
> I don't have to much knowledge about the math I need. So I hope my
> explanation what I want to achieve is right.
>
> I want to use a curve-function (f.e. a cubic-bezier) which is defined
> through points laying in the x,y-plane (2D-curve) in a function for a
> texture. Where the curve runs, the function should give back 1 and it
> should have a fallof described through a factor f (fallof maybe like when
> using an airbrush) so the function gives back 0 when the texture-point to
> be calculated is away  f.e. 0.01 povray-units.
>
> If 1 povray-unit would be 1 meter, this function should draw a texture
which
> would be a line defined by the points of the bezier-curve and a fallof to
0
> in a distance of 0.01 units to both side of the curve.
>
> The goal would be, that one could just draw text using a bezier-curve for
a
> letter in a program, export the points, and by just putting the point-list
> in to the povray-function could use the drawn-text as texture.
>
> I hope it's not do difficult.
>
> Greetings
> Dieter
>
>


Post a reply to this message

From: ABX
Subject: Re: How to use a bezier-curve (2D) for a function to use in a texture?
Date: 14 Sep 2004 03:01:53
Message: <tg5dk050kgd273j9gegcpdbivnp5g87gf8@4ax.com>
On Mon, 13 Sep 2004 21:56:15 -0400, "David Wallace" <dar### [at] earthlinknet>
wrote:
> I want that function, too, but for a different purpose.  If I could
> calculate the distance from a 2D-point in space to the nearest point on a
> bezier spline,  I would be drawing rivers and streams in landscapes.  I
> suspect the math would be rather egregious, though.

Having lathe-bezier within spline{} does not automatically makes you able to
calculate distance between point and spline thought knowing spline equation
you can indeed calculate distance. Note that MegaPOV contains polynomial
solver (the same as used for lathe internally) which can be used for such
calculations.

ABX


Post a reply to this message

From: Scott Gammans
Subject: Re: How to use a bezier-curve (2D) for a function to use in a texture?
Date: 14 Sep 2004 09:53:21
Message: <4146F7D0.20205@yahoo.com>
David:

Take a look at the functions that Tor Olav Kristensen posted in the 
thread I started above (the one about bezier splines missing from the 
spline{} object in POV-Ray).

I was looking for a way to sweep spheres along a bezier spline, and his 
functions work perfectly, but one of the nice side-benefits is that his 
functions also calculate the u-v coordinates of a bezier spline at any 
point *along* the spline. It sounds like that might be what you're 
looking for...

-----
Scott Gammans
Washington, DC


David Wallace wrote:
> I want that function, too, but for a different purpose.  If I could
> calculate the distance from a 2D-point in space to the nearest point on a
> bezier spline,  I would be drawing rivers and streams in landscapes.  I
> suspect the math would be rather egregious, though.
> 
> "D. H. Berlin" <wee### [at] PoVStefaniede> wrote in message
> news:web.41427fd3c601232d88e4a61c0@news.povray.org...
> 
>>Hi!
>>
>>I don't have to much knowledge about the math I need. So I hope my
>>explanation what I want to achieve is right.
>>
>>I want to use a curve-function (f.e. a cubic-bezier) which is defined
>>through points laying in the x,y-plane (2D-curve) in a function for a
>>texture. Where the curve runs, the function should give back 1 and it
>>should have a fallof described through a factor f (fallof maybe like when
>>using an airbrush) so the function gives back 0 when the texture-point to
>>be calculated is away  f.e. 0.01 povray-units.
>>
>>If 1 povray-unit would be 1 meter, this function should draw a texture
> 
> which
> 
>>would be a line defined by the points of the bezier-curve and a fallof to
> 
> 0
> 
>>in a distance of 0.01 units to both side of the curve.
>>
>>The goal would be, that one could just draw text using a bezier-curve for
> 
> a
> 
>>letter in a program, export the points, and by just putting the point-list
>>in to the povray-function could use the drawn-text as texture.
>>
>>I hope it's not do difficult.
>>
>>Greetings
>>Dieter
>>
>>
> 
> 
>


Post a reply to this message

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