POV-Ray : Newsgroups : povray.binaries.images : Glow splines - Attn Andy Cocker, et al Server Time
19 Aug 2024 18:29:20 EDT (-0400)
  Glow splines - Attn Andy Cocker, et al (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Alan Holding
Subject: Glow splines - Attn Andy Cocker, et al
Date: 5 Dec 2000 19:22:51
Message: <3a2d86db@news.povray.org>
Hello, all.

This will all link up in a minute...

A while ago, Chris Colefax was very kind in supplying me with a MegaPOV
compatible version of his Spline Macro File.

After reading Andy Cocker's recent posts about trying to write a macro which
could do 'glows on a string', I tried to see if I could use Chris's macro to
come up with a solution.  And I think I have, as the attached image shows.

For those unfamiliar with the Spline Macro, apologies for the next bit.

To make the image, I defined a glow as a spline_object like this...

#macro spline_object ()
   glow {type 1 location sPos colour rgb
<1.35-(sProgress*1.5),0.5,sProgress> size 0.01}
#end

...the important bit being the 'location sPos' part, which gets around the
fact that glows can't be transformed as the Spline Macro defines where the
glow should go in the 'chain' via the sPos variable.

Next, I defined a spline for the glows to follow...

#local glow_spline=create_spline (
  array[4] {<-40,0,0>,<-10,50,0>,<30,-80,0>,<40,20,0>},
  create_bezier_spline + spline_tension (0.4) + spline_sampling (on) +
spline_loop (no)
)

...and finally called the finished spline:

create_spline_object (glow_spline, spline_steps (40) + spline_radius (0.1))

Bingo.  Glows on a chain.

I'd post the code in p.t.s-f, but I don't think Chris has made the MegaPOV
version of his Spline Macro publically available yet.

Chris?  Am I OK to post it?

Bye,
Alan.


Post a reply to this message


Attachments:
Download 'glow_spline.jpg' (11 KB)

Preview of image 'glow_spline.jpg'
glow_spline.jpg


 

From: Alan Holding
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 5 Dec 2000 20:36:35
Message: <3a2d9823@news.povray.org>
Forgot to mention that it also works OK if you define the spline_object ()
as a light_source...

#macro spline_object ()
   light_source {sPos rgb <whatever> glow {type 0 size 0.4}}
#end

...as in the attached image.

Bye,
Alan.


Post a reply to this message


Attachments:
Download 'glows_spline2.jpg' (9 KB)

Preview of image 'glows_spline2.jpg'
glows_spline2.jpg


 

From: Chris Huff
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 6 Dec 2000 05:38:15
Message: <chrishuff-4B763D.05390106122000@news.povray.org>
In article <3a2d86db@news.povray.org>, "Alan Holding" 
<man### [at] lineonenet> wrote:

> After reading Andy Cocker's recent posts about trying to write a 
> macro which could do 'glows on a string', I tried to see if I could 
> use Chris's macro to come up with a solution.  And I think I have, as 
> the attached image shows.

Why use the macro when splines are available as a built-in feature? Are 
there some special features it has?


> Chris?  Am I OK to post it?

Which Chris? ;-)

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Warp
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 6 Dec 2000 06:22:24
Message: <3a2e2170@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: Why use the macro when splines are available as a built-in feature? Are 
: there some special features it has?

  Can the built-in spline place the points evenly along the curve?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Colefax
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 6 Dec 2000 07:51:12
Message: <3a2e3640@news.povray.org>
Alan Holding <man### [at] lineonenet> wrote:
[snip]
> I'd post the code in p.t.s-f, but I don't think Chris has made the MegaPOV
> version of his Spline Macro publically available yet.
>
> Chris?  Am I OK to post it?

By all means, post the SplineMP.mcr file I sent you if it's needed for what
you wish to do (and allow others to do)...


Post a reply to this message

From: Chris Colefax
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 6 Dec 2000 07:51:18
Message: <3a2e3646@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
> Why use the macro when splines are available as a built-in feature? Are
> there some special features it has?

In a word, Yes.  I knew spline functions were available in POV patches when
I was working on my Spline macro file, and I expected that these would find
their way into a future official version of POV-Ray.  Because of this, I
didn't want to spend my time creating something that would very quickly
become obsolete (after all, I already had a spline include file that seemed
to serve people quite well).

As a result, simply calculating splines positions given a list of points is
the very least the file does.  Firstly, it offers the ability to create all
the cubic interpolating splines, from Catmull-Rom to cardinal right through
to Kochanek-Bartels (TCB) splines, as well as hermite and Bezier splines.
This gives much more control over the shape of the spline, and allows you to
explore all sorts of curves that may pass through a single set of points
(see the first page of the Spline Macro tutorial at
http://www.geocities.com/ccolefax/spline).

Also, as Warp mentioned, it includes a full set of sampling functions so you
can find the length of splines, create splines tensioned to fit a specified
length, and returns points evenly spaced along a spline.  It also includes a
caching function to speed up the usage of sampled splines.

On top of that, the system includes a set of macros that fully automate the
use of splines for animation and object creation, which can be customised
partly or completely.  Alan has used various features (the Bezier spline,
tensioning, sampling, custom object creation macros), and while it's true
similar results could have been achieved using the internal spline function,
to have things like the evenly distributed glows would entail recreating
much of what my macro file already does!


Post a reply to this message

From: Alan Holding
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 6 Dec 2000 13:41:19
Message: <3a2e884f@news.povray.org>
"Chris Colefax" <chr### [at] tagpovrayorg> wrote in message
news:3a2e3640@news.povray.org...
>
> By all means, post the SplineMP.mcr file I sent you if it's needed for
what
> you wish to do (and allow others to do)...
>

OK.  I'll post it to povray.binaries.scene-files.

Fank yew.


Post a reply to this message

From: Chris Huff
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 6 Dec 2000 16:54:10
Message: <chrishuff-DC2360.16545706122000@news.povray.org>
In article <3a2e2170@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Can the built-in spline place the points evenly along the curve?

Not on it's own, you would have to write the code to do that 
yourself(which shouldn't be too hard...) However, that's an interesting 
idea for a new spline feature...you could just add "constant_speed" or 
something to get that result.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Warp
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 7 Dec 2000 10:56:59
Message: <3a2fb34b@news.povray.org>
Chris Huff <chr### [at] maccom> wrote:
: Not on it's own, you would have to write the code to do that 
: yourself(which shouldn't be too hard...) However, that's an interesting 
: idea for a new spline feature...you could just add "constant_speed" or 
: something to get that result.

  Why, when there's already a macro for doing that?
  Why double the effort?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Andy Cocker
Subject: Re: Glow splines - Attn Andy Cocker, et al
Date: 7 Dec 2000 15:17:11
Message: <3a2ff047@news.povray.org>
Alan,

Thanks very much. This looks great.

All the best,

Andy Cocker


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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