## Trying to reproduce an effect described in Advanced animation and rendering techniques

### Trying to reproduce an effect described in Advanced animation and rendering techniques

I am trying to write a renderman shader to reproduce a flame shape
described in Advanced animation and rendering techniques by Watt &
Watt. The description is at page 211. Basically they are saying that
you can get the flame shape by using the following function:

flame(P) = (1 - y/h) flame_colour(abs(x/b)) where  P = (x,y)

where the flame is defined in the 2D rectangle going form (-b,0) to
(b,h)

Flame_colour is a function that returns the color of the flame along a
scalar value. My question is how can you get the round shape of the
flame by simply multiplying the flame_colour with (1-y/h)? This will
not produce any round shape but will simply attenuate the color along
the y axis which is not what we are looking for. This looks like an
error to me. Any help would be appreciated.

### Trying to reproduce an effect described in Advanced animation and rendering techniques

Oh well. I found the solution to my problem so I might as well post it
here.

There is indeed an error in the book Advanced Animation and Rendering
Techniques by Watt & Watt.

The function needed to reproduce the flame on Plate 27 should have
been something like:

flame(X) = flame_colour(sqrt((abs(x/b)^2 + (1-y/h)^2))

flame(X) = (1-y/h) flame_colour(abs(x/b))

It's no big deal really but you would expect a book with such
reputation to not have errors like that.

> I am trying to write a renderman shader to reproduce a flame shape
> described in Advanced animation and rendering techniques by Watt &
> Watt. The description is at page 211. Basically they are saying that
> you can get the flame shape by using the following function:

> flame(P) = (1 - y/h) flame_colour(abs(x/b)) where  P = (x,y)

> where the flame is defined in the 2D rectangle going form (-b,0) to
> (b,h)

> Flame_colour is a function that returns the color of the flame along a
> scalar value. My question is how can you get the round shape of the
> flame by simply multiplying the flame_colour with (1-y/h)? This will
> not produce any round shape but will simply attenuate the color along
> the y axis which is not what we are looking for. This looks like an
> error to me. Any help would be appreciated.

### Trying to reproduce an effect described in Advanced animation and rendering techniques

Errata from books are usually listed on the web site of the publisher.  It
is why you often see a "second edition" of such and such book.  Shit
happens.

> Oh well. I found the solution to my problem so I might as well post it
> here.

> There is indeed an error in the book Advanced Animation and Rendering
> Techniques by Watt & Watt.

> The function needed to reproduce the flame on Plate 27 should have
> been something like:

> flame(X) = flame_colour(sqrt((abs(x/b)^2 + (1-y/h)^2))

> flame(X) = (1-y/h) flame_colour(abs(x/b))

> It's no big deal really but you would expect a book with such
> reputation to not have errors like that.

- Show quoted text -

Quote:> > I am trying to write a renderman shader to reproduce a flame shape
> > described in Advanced animation and rendering techniques by Watt &
> > Watt. The description is at page 211. Basically they are saying that
> > you can get the flame shape by using the following function:

> > flame(P) = (1 - y/h) flame_colour(abs(x/b)) where  P = (x,y)

> > where the flame is defined in the 2D rectangle going form (-b,0) to
> > (b,h)

> > Flame_colour is a function that returns the color of the flame along a
> > scalar value. My question is how can you get the round shape of the
> > flame by simply multiplying the flame_colour with (1-y/h)? This will
> > not produce any round shape but will simply attenuate the color along
> > the y axis which is not what we are looking for. This looks like an
> > error to me. Any help would be appreciated.

written by Mark and Alan Watt.

In a nutshell, the book is one of the best in its field.  It covers a
lot of terrain that many books just skim over, including one of the
author's previous efforts, "Fundamentals....3d graphics".  Various
topics that it covers rather thoroughly ( and that I thought were
not very well documented in other publications ).

1.  Euler angles
2.  Quaternions
3.  Inverse kinematics
4.  Forward kinematics
5.  Ray tracking ( including backwards ray tracing, cone tracing, etc. )
6.  Volume rendering
7.  Texture/environment/procedural mapping
8.  Soft object deformations

These are the major things it covers....and all the code is in C, not
Pascal like "Fundamentals...." or Foley and Van Dam.

Well worth the 44.95 dollars ( US ).

Brian

6. printing