3-D IFS fractals as real-time graphics model

3-D IFS fractals as real-time graphics model

Comput. & Graphics. Vol. 21, No. 3, pp. 367-370, 1997 t: 1997 ElsevierScienceLtd. All rights reserved Printed in Great Britain 0097~8493197 $17.00 + 0...

4MB Sizes 5 Downloads 92 Views

Comput. & Graphics. Vol. 21, No. 3, pp. 367-370, 1997 t: 1997 ElsevierScienceLtd. All rights reserved Printed in Great Britain 0097~8493197 $17.00 + 0.00

PII: s0097-8493(97)0001&9

Chaos & Graphics

3-D IFS FRACTALS YAN

AS REAL-TIME QIU CHEN’

GRAPHICS

and GUOAN

MODEL

BI

School of EEE. Nanyang Technological University, Singapore 639798 Abstract-Fractals have recently been attracting increasing research interest. Unlike conventional geometrical figures, fractals have unlimited details-a potentially useful feature for artistic images. One way to generate fractals is to use Iterated Function Systems (IFS). There have been significant research efforts on Z-D IFS. Programs for rendering 2-D IFS fractals are readily available. 3-D IFS appear to be a natural extension but remain an area to be investigated. This paper explores the use of 3-D IFS for creating fascinating fractal scenes. An efficient coloring, lighting and mist effects scheme is proposed. A program using the proposed scheme has been developed that can render delicate scenes consisting of multiple IFS fractals in real-time on the PC. ~6 1997 Elsevier Science Ltd

1. INTRODUCTION Since Mandelbrot coined the term “fractal” two decades ago [l]. fractal geometry has been receiving increasing attention. Fractals are very different from conventional geometrical figures such as triangles, squares, cubes, etc. in that fractals have infinite details--one can “magnify” a fractal and observe fascinating details. This distinctive characteristic is arguably the key to generating aesthetically appealing imagery. There are two major methods for generating fractals. One is to apply an iterative process to some seemingly simple equations and obtain fractals such as the Mandelbrot set. the Julia set, etc. New formulae for generating beautiful fractals have also been proposed [2]. The other is to use Iterated Function Systems (IFS) which consist of a number of affine transforms. There have been past studies on rendering 2-D IFS fractals [3-51. Programs for generating 2-D IFS fractals are widely available, r.g. Fractint, Fdesign, etc. 3-D IFS, which appear to be a natural extension, is still largely an area to be explored. The presently available software for generating 3-D IFS fractals, e.g. 3dfract (http:// www.cstp.umkc.edu/users/bhugh/home.html), cannot produce satisfactory imagery. This paper studies the use of 3-D IFS as graphics models for generating fascinating artificial scenes. It proposes an efficient coloring, lighting and mist effects scheme. A program is developed that renders scenes consisting of a number of fractals in real-time on a PC. showing the effectiveness of the proposed scheme. 2. THREE-DIMENSIONAL IFS A 3-D linear IFS consists of a number transforms taking the form

or, in matrix format,

[‘:I=[;;;

;;

~~][:]+[~:I

The term ‘affine’ refers to the geometrical property that this class of transforms maps lines to lines. If the transforms are contractive, i.e., the transforms reduce the distance between any two points. then there exists a unique set K for the IFS such that K = u:ilfi[ K]. This unique invariant set (attractor) is termed the fractal generated by the IFS. 3. COLORING THE FRACTALS Fractals are self-similar. An IFS fractal is made up of a number of smaller copies of itself. Each such copy is generated by one of the affine transforms. For an IFS consisting of n transforms ,f,.f;, , Jl, the fractal generated by the IFS has n smaller copies of itself generated by the n transforms. We identify each copy with the transform that generates it. The II copies therefore are identified as “f,“,“f2”, ‘:f,“. Each of the n copies can be further broken into II smaller copies. We identify them with a twocharacter string: for the n smaller constituent copies of the copy identified with “A.“. the identifying strings are ‘:f, f;“.‘% A”, ‘Ifi fn”. In general. subsets of an IFS fractal can be identified with strings of transform identifiers. The color of a region is then determined by the ratio of th’: viewed light to the incoming light in terms of RGB components: the ratio for the red component r,, the ratio for the green component rs, and that for the blue component rh. They form a triple (r,.,rg,rh). The triple (l,O,O) is red since the red component of the incoming light is wholly passed

of affine

’ Author for correspondence. 367

368

Y. Q, Chen and G. Bi

Fig. 1. Ferns on the Sierpinsky gasket.

to the viewer while the green and blue components are lost. The triple (0.5, 0.5, 0.5) is grey since half of the red, green, and blue components of the incoming light is passed to the viewer.

4. LIGHTING

THE

SCENE

The proposed lighting scheme consists of an ambient lighting component and a number of point light sources. The intensity of the ambient lighting is

Fig. 2. Pyramid surrounded by trees

3-D

Fig.

IFS

3. Clouds

expressed in RGB components: A = (a,.,a,,a~,)~ where T denotes the transposition operation. The intensity of the point light sources are also expressed in RGB components: Pi= (Pir,Pip,Pib)r for the ith point light source. The composite lighting intensity at the point (.Y,J,z) can be calculated with the following equation: I=A+):-

p,

7 I i.Y, - .$ + (y, - Jq2 + (z; - z)-

(1)

where (.Y~,J~~.zJis the location of the ith point light source. Given the composite lighting intensity I and the the intensity of the colour of the point C = (r,,rz,r& light emitting from the point I’ can be calculated with I’ = ICT

5. PRODUCING

MIST

(2)

EFFECTS

Mist effects are important cues for the perception of the distance of an object. In a misty environment, the further away the objects are from the camera, the weaker the observed light from the object is. The object becomes dimmer as the distance increases and eventually vanishes into the background when the distance tends to infinity. In other words. the observed light intensity from an object gradually changes from the initial value r to that of the background lighting intensity B= (l~,.,h,~,h,,) as the distance increases. This is modeled with

fractals

369

on carpet.

I” = tz’ + (1 - t)B

(3)

where 1

t=1 + (l/d)

(Xc - .$ + (J< -J))’

+ (Z< ~ z)’

(.x,J,,z,,) are the camera coordinates. (xJ,~) are the object coordinates. d is the distance at which the light coming from the object reduces to half of its original value. 6. RESULTS

A program has been developed to render fractal scenes using the coloring, lighting. and mist effects model proposed in the paper. It can render scenes consisting of multiple IFS fractals in real-time on a Pentium w.nch demonstrates the efficiency of the proposed scheme. The rendering software FractMovie is available at the author’s home page (http:!/home. pacific.net.sg/wyqchen). Figures l-3 are snapshots taken from the PC screen. They appear delicate and aesthetically appealing. We may conclude from the results that (1) 3-D IFS fractals are good candidates for constructing fascinating 3-D scenes; (2) the proposed coloring, lighting, and mist effects scheme is efficient so that fractal scenes consisting of multiple 3-D IFS can be rendered in real-time on a PC. 7. CONCLUSION

This paper proposes the use of 3-D IFS fractals for constructing artificial scenes. A coloring. lighting. and mist effects scheme is suggested. A program imple-

Y. Q. Chen and G. Bi

370

mentingthe schemehasbeendevelopedfor rendering IFS scenes in real-timeon a PC. The resultsshowthat IFS fractals are good candidatesfor constructing delicateand aestheticallyappealingscenes. REFERENCES

1. Mandelbrot, B. B., Fractals: Form, Chance and Dimension. Freeman, San Francisco, 1977.

2. Sprott, J. C., Strange attractor symmetric icons. Computers & Graphics, 1996, 20, 325-332. 3. Barnsley, M. F., Fractals Everywhere. Academic Press. New York, 1988. 4. Monro, D. M. and Budbridge, F., Rendering algorithms for deterministic fractals. IEEE Computer Graphics and Its Applications, 1995, 32-41. 5. Bell, S. B. M., Fractals: a fast, accurate and iliuminating algorithm. Image and Vision Computing, 1995. 13, 253-251.