 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Hi,
I just wrote my first macro, and although it's probably incredibly simple to
most of you, I'm still quite pleased.
The macro simply places a number of glows equally spaced between two points.
It would be improved if the glowstring could be made 'slack', so that it
dropped in the middle as though affected by gravity, but I have absolutely
no idea how to do something like that.
Anyway, I've posted my little macro in p.t.s.f, called GlowSting Macro. If
anyone wants to improve it, I'd be interested in seeing what changes you
make. For example, is there a better way of doing it than using a #while()
loop?
Ok, here's a pic I made using the macro:
Post a reply to this message
Attachments:
Download 'GlowString.jpg' (27 KB)
Preview of image 'GlowString.jpg'

|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker wrote:
Looks...bright :) Thats hurting my eyes
> The macro simply places a number of glows equally spaced between two
> points. It would be improved if the glowstring could be made 'slack', so
> that it dropped in the middle as though affected by gravity, but I have
> absolutely no idea how to do something like that.
Take a look at the MakeTree macro - it allows the tree to be "pushed" and
"pulled" by a gravity vector. It looks like what you want is a severly
compressed quadratic (1/200x^2), let x run bewteen one end, to zero, then
to the other end. The equation will then produce the right y coordinate.
You could get fancy, define a zero point and all too (+ a second
compression ratio for the other end ;)) (that would be useful in
animations, a rippling whip or rope).
Anyway, enough of this :)
Looks great!
Yann
>
> Anyway, I've posted my little macro in p.t.s.f, called GlowSting Macro. If
> anyone wants to improve it, I'd be interested in seeing what changes you
> make. For example, is there a better way of doing it than using a #while()
> loop?
>
> Ok, here's a pic I made using the macro:
>
>
--
--------------------------------------------------------------------
Yann Ramin atr### [at] atrustrivalie eu org
Atrus Trivalie Productions www.redshift.com/~yramin
AIM oddatrus
Marina, CA http://profiles.yahoo.com/theatrus
IRM Developer Network Toaster Developer
SNTS Developer KLevel Developer
Electronics Hobbyist person who loves toys
Build a man a fire, and he's warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.
"I'm prepared for all emergencies but totally unprepared for everyday
life."
--------------------------------------------------------------------
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker wrote:
> The macro simply places a number of glows equally spaced between two points.
> It would be improved if the glowstring could be made 'slack', so that it
> dropped in the middle as though affected by gravity, but I have absolutely
> no idea how to do something like that.
That would be a parabola (actually, a catenoid, but parabola suffices and
mathworld.wolfram.com is down).
To find arc length is difficult...
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
David Fontaine wrote:
> That would be a parabola (actually, a catenoid, but parabola suffices and
> mathworld.wolfram.com is down).
>
> To find arc length is difficult...
1) Find parametric equations for the parabola
xt = t
yt = at^2 + bt + c
2) Differentiate these equations
x't = 1
y't = 2at + b
3) Use pythagorean theorem to find how fast (x,y) is moving with respect to t
sqrt(4a^2t^2 + 4abt + b^2 + 1)
4) Integrate to get an equation for arc length
It helps to have values of a, b and c before you start...
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Thankyou both for your replies, but I'm not ashamed to admit that both your
answers are *way* beyond me and my mathematical capabilities :-). As I said,
this is my first macro, and I'm not really sure how to progress from here. I
*really* wish that I could write such a macro though... glows would be
wonderful in conjunction with code that allows them to be strung loosely
between two points... ideal for this time of year and Xmas scenes.
Thanks again,
Andy Cocker
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker wrote:
> Thankyou both for your replies, but I'm not ashamed to admit that both your
> answers are *way* beyond me and my mathematical capabilities :-). As I said,
> this is my first macro, and I'm not really sure how to progress from here. I
> *really* wish that I could write such a macro though... glows would be
> wonderful in conjunction with code that allows them to be strung loosely
> between two points... ideal for this time of year and Xmas scenes.
Well, I can get as far as the integral equation, but solving it is tricky... :)
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker wrote:
>
> Thankyou both for your replies, but I'm not ashamed to admit that both your
> answers are *way* beyond me and my mathematical capabilities :-). As I said,
> this is my first macro, and I'm not really sure how to progress from here. I
> *really* wish that I could write such a macro though... glows would be
> wonderful in conjunction with code that allows them to be strung loosely
> between two points... ideal for this time of year and Xmas scenes.
>
Well, you could always get a look at C. Colefax's chain macros. They
should provide a good starting point.
Jérôme
--
********************************* Jérôme M. BERGER
* Abandon the search for truth, * mailto:ber### [at] iname com
* Settle for a good fantasy. * http://www.enst.fr/~jberger
*********************************
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker <big### [at] mariner9 fsnet co uk> wrote:
> Hi,
> I just wrote my first macro, and although it's probably incredibly simple to
> most of you, I'm still quite pleased.
> The macro simply places a number of glows equally spaced between two points.
> It would be improved if the glowstring could be made 'slack', so that it
> dropped in the middle as though affected by gravity, but I have absolutely
> no idea how to do something like that.
> Anyway, I've posted my little macro in p.t.s.f, called GlowSting Macro. If
> anyone wants to improve it, I'd be interested in seeing what changes you
> make. For example, is there a better way of doing it than using a #while()
> loop?
Well, if you want, I've got a macro that uses the hyperbolic functions to do
the drop, which I used for the rope in my IRTC image from the SEA
competition. It calculates the appropriate points given a 'lowest' point on
the hyperbola, and returns a vector of them. There is another macro out
there for doing this, but IIRC, it uses a parabola, which isn't realistic in
some cases, though a good approximation.
Geoff
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Geoff Wedig" <wed### [at] darwin epbi cwru edu> wrote in message
news:3a2b9499@news.povray.org...
> Well, if you want, I've got a macro that uses the hyperbolic functions to
do
> the drop, which I used for the rope in my IRTC image from the SEA
> competition. It calculates the appropriate points given a 'lowest' point
on
> the hyperbola, and returns a vector of them. There is another macro out
> there for doing this, but IIRC, it uses a parabola, which isn't realistic
in
> some cases, though a good approximation.
Yes Geoff, I would be interested in having a look at your macro, though I'm
not sure if I'll be able to understand it (my concentration is very poor).
Please either post it on the server, or mail it to me direct.
Thanks,
Andy Cocker
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker wrote:
That looks like a great candidate for the kind of street advertising
graphics as in Bladerunner. The typeface has to change but the overall
effect is quite impressive.
--
If evolution has a direction
why don't squirrels have keyboards?
-- The Iron Webmaster, 290
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Matt Giwer" <jul### [at] ij net> wrote in message
news:3A2BE291.C81167CF@ij.net...
> Andy Cocker wrote:
>
> That looks like a great candidate for the kind of street advertising
> graphics as in Bladerunner. The typeface has to change but the overall
> effect is quite impressive.
That's a good point Matt... I was wondering what these glows were reminding
me of, and it is Bladerunner.
Actually, somebody posted some code a while ago that reads in a bitmap
image, and rebuilds that image as an array of objects, each taking their
colour from the bitmap (I forget what the technique is called). I wonder if
this could be applied to an array of glows.. It would look fantastic if a
sequence of images were used as a source... like those huge video
billboards!
Andy Cocker
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
On Mon, 4 Dec 2000 18:37:41 -0000, Andy Cocker wrote:
>Actually, somebody posted some code a while ago that reads in a bitmap
>image, and rebuilds that image as an array of objects, each taking their
>colour from the bitmap (I forget what the technique is called). I wonder if
>this could be applied to an array of glows.. It would look fantastic if a
>sequence of images were used as a source... like those huge video
>billboards!
You've got me thinking now: Can of Coke, Pretty girls face, A company logo,
Something in Chinese then back to the Coke again.
Of course the streets would have to be wet with rain, and I could use
my trafficlights macro, and have traffic going past etc.
--
Cheers
Steve email mailto:ste### [at] zeropps uklinux net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
8:34pm up 54 days, 22:59, 2 users, load average: 1.25, 1.15, 1.10
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Andy Cocker wrote:
>
>...
> Actually, somebody posted some code a while ago that reads in a bitmap
> image, and rebuilds that image as an array of objects, each taking their
> colour from the bitmap (I forget what the technique is called). I wonder if
> this could be applied to an array of glows.. It would look fantastic if a
> sequence of images were used as a source... like those huge video
> billboards!
Xplo Eristotle also suggested something like this in my
"Fibonacci Stones" thread:
news://news.povray.org/39B5728A.54AE8936%40unforgettable.com
In my "Fibonacci Mosaics" thread:
news://news.povray.org/39B65D7C.9BE96D79%40online.no
the colouring of the blobs in these images are done
according to the colours in another image.
I can post the code for it. (But you would probably
want to do it the Mega-POV way :)
Tor Olav
--
mailto:tor### [at] hotmail com
http://www.crosswinds.net/~tok/tokrays.html
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a2be4f0@news.povray.org>, "Andy Cocker"
<big### [at] mariner9 fsnet co uk> wrote:
> I wonder if this could be applied to an array of glows.. It would
> look fantastic if a sequence of images were used as a source... like
> those huge video billboards!
Somebody has actually done this before...use eval_pigment() to get the
color of an image_map at the position of each glow.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3a2a38ec@news.povray.org>, "Andy Cocker"
<big### [at] mariner9 fsnet co uk> wrote:
> For example, is there a better way of doing it than using a #while()
> loop?
I don't know what you intend...this is exactly what #while loops were
created for, the other ways would be recursing macros(unnecesarily
inefficient, limited, and slow for just making a straight line), and
doing it by hand. #while loops are the best way to do it.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Chris Huff wrote:
> > For example, is there a better way of doing it than using a #while()
> > loop?
>
> I don't know what you intend...this is exactly what #while loops were
> created for, the other ways would be recursing macros(unnecesarily
> inefficient, limited, and slow for just making a straight line), and
> doing it by hand. #while loops are the best way to do it.
Nah, #for loops are ;)
--
David Fontaine <dav### [at] faricy net> ICQ 55354965
My raytracing gallery: http://davidf.faricy.net/
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
"Andy Cocker" <big### [at] mariner9 fsnet co uk> wrote in message
news:3a2be4f0@news.povray.org...
> Actually, somebody posted some code a while ago that reads in a bitmap
> image, and rebuilds that image as an array of objects, each taking their
> colour from the bitmap (I forget what the technique is called). I wonder
if
> this could be applied to an array of glows.. It would look fantastic if a
> sequence of images were used as a source... like those huge video
> billboards!
That might have been me and the POV glow logo thing I did. The code is
still in p.b.s-f under 'Glow Logo zip' or something similar. But! I did it
in a very kludgy fashion that I wouldn't recommend you repeating. Me no
code demon either...
Bye.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
In article <3A2C6874.91B7CC4D@faricy.net>, David Fontaine
<dav### [at] faricy net> wrote:
> Nah, #for loops are ;)
How can #for loops be the best way to do things if you have to write the
patch first? :-)
I agree that they would be a good idea, and if they did exist, they
would be the best way to do it...
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |