Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fractal cloud generation

3 views
Skip to first unread message

Carsten Leue

unread,
Oct 16, 1996, 3:00:00 AM10/16/96
to

Has anybody got information on how to generate realistic, fractal
clouds for computer graphics?
I would be interested in any algorithm or literature on this subject.

Thank you very much,
Carsten

William Portnoy

unread,
Oct 20, 1996, 3:00:00 AM10/20/96
to Carsten Leue

Daniel Paulo Carvalho - Aluno Eng. Informatica

unread,
Oct 24, 1996, 3:00:00 AM10/24/96
to

Carsten Leue (cl...@giotto.iwr.uni-heidelberg.de) wrote:
: Has anybody got information on how to generate realistic, fractal
: clouds for computer graphics?
: I would be interested in any algorithm or literature on this subject.

A book that has some ideas for doing that is Pauline Baker's "Computer
graphics" (Prentice Hall, 2nd. Edition - 1995). Is not the best book for
this subject, but it can give you a help.
Hope you find it helpfull
Daniel
d...@students.fct.unl.pt

Richard Ottolini

unread,
Oct 25, 1996, 3:00:00 AM10/25/96
to

I suspect incorporating a lighting model is essential-
clouds are both translucent and illuminated by sun above.
Thicker is whiter; upper is whiter.

Tim Sweeney

unread,
Oct 25, 1996, 3:00:00 AM10/25/96
to

Daniel Paulo Carvalho - Aluno Eng. Informatica <d...@students.fct.unl.pt>
wrote in article <54ng6h$l...@host.di.fct.unl.pt>...

> Carsten Leue (cl...@giotto.iwr.uni-heidelberg.de) wrote:
> : Has anybody got information on how to generate realistic, fractal
> : clouds for computer graphics?
> : I would be interested in any algorithm or literature on this subject.

Here is some code I snipped from the game I'm programming.

//
// Make a random tiled 2D fractal texture of size US*VS.
// Dest is an array of US*VS floats whose values range from 0.0 to 1.0.
//
void MakeTiledFractal(FLOAT *Dest, int Size)
{
void *MemTop = GMem.Get(0); // this is a simple memory pool

// Make sure Size is a power of two:
if( Size&(Size-1) ) appError("Size not power of two");

// Make wraparound table
INT* WrapU = (INT*)GMem.GetFast((Size+1)*sizeof(INT)); // snag some memory
INT* WrapV = (INT*)GMem.GetFast((Size+1)*sizeof(INT));
for( int i=0; i<Size; i++)
{
WrapU[i]=i;
WrapV[i]=i*Size;
}
WrapU[Size] = WrapV[Size] = 0;

// Init random index
int iRand = 0;

// Init base
Dest[0] = 0.6 * 0.5;

FLOAT Range = 0.6 * 0.5;
int Speed = Size;

// Descend through mesh
for( Speed=Size/2; Speed; (Speed /= 2, Range *= 0.5) )
{
FLOAT *Dest0 = &Dest[0];
FLOAT *Dest1 = &Dest[Speed*Size];
for( int v=Speed; v<Size; v+=Speed+Speed )
{
FLOAT *Dest2 = &Dest[WrapV[v+Speed]];
for( int u=Speed; u<Size; u+=Speed+Speed )
{
FLOAT Base =
(
+ Dest0[ u-Speed ]
+ Dest0[WrapU[u+Speed]]
+ Dest2[ u-Speed ]
+ Dest2[WrapU[u+Speed]]
) * 0.25;
// GRandoms->Random(seed)
is just a random number
// from 0.0 to 1.0.
Dest1[u-Speed] = Base + Range * (-1.0 + 2.0 *
GRandoms->Random(iRand+0));
Dest0[u ] = Base + Range * (-1.0 + 2.0 *
GRandoms->Random(iRand+1));
Dest1[u ] = Base + Range * (-1.0 + 2.0 *
GRandoms->Random(iRand+2));
iRand += 3;
}
Dest0 += (Speed + Speed) * Size;
Dest1 += (Speed + Speed) * Size;
}
}
GMem.Release(MemTop);
}


Al Zimmerman

unread,
Oct 25, 1996, 3:00:00 AM10/25/96
to

Daniel Paulo Carvalho - Aluno Eng. Informatica wrote:
>
> Carsten Leue (cl...@giotto.iwr.uni-heidelberg.de) wrote:
> : Has anybody got information on how to generate realistic, fractal
> : clouds for computer graphics?

http://climate.gsfc.nasa.gov/~cahalan/FractalClouds/FractalClouds.html

0 new messages