Attempt to fix nightly build.
[AROS-Contrib.git] / gfx / povray / txttest.c
blob40fe91abd6fcffe91500d80ab4ea8fe9a0b2cc20
1 /****************************************************************************
2 * txttest.c
4 * This module implements "fill-in-the-blank" pre-programmed texture
5 * functions for easy modification and testing. Create new textures here.
7 * from Persistence of Vision(tm) Ray Tracer
8 * Copyright 1996,1999 Persistence of Vision Team
9 *---------------------------------------------------------------------------
10 * NOTICE: This source code file is provided so that patterns may experiment
11 * with enhancements to POV-Ray and to port the software to platforms other
12 * than those supported by the POV-Ray Team. There are strict rules under
13 * which you are permitted to use this file. The rules are in the file
14 * named POVLEGAL.DOC which should be distributed with this file.
15 * If POVLEGAL.DOC is not available or for more info please contact the POV-Ray
16 * Team Coordinator by email to team-coord@povray.org or visit us on the web at
17 * http://www.povray.org. The latest version of POV-Ray may be found at this site.
19 * This program is based on the popular DKB raytracer version 2.12.
20 * DKBTrace was originally written by David K. Buck.
21 * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
23 *****************************************************************************/
26 * Some texture ideas garnered from SIGGRAPH '85 Volume 19 Number 3,
27 * "An Image Synthesizer" By Ken Perlin.
29 * Further Ideas Garnered from "The RenderMan Companion" (Addison Wesley)
32 #include "frame.h"
33 #include "vector.h"
34 #include "povproto.h"
35 #include "texture.h"
36 #include "povray.h" /* [DB 9/94] */
37 #include "txttest.h" /* [DB 9/94] */
38 #include "pattern.h" /* [CY 10/94] */
42 /*****************************************************************************
43 * Local preprocessor defines
44 ******************************************************************************/
48 /*****************************************************************************
49 * Local typedefs
50 ******************************************************************************/
54 /*****************************************************************************
55 * Local variables
56 ******************************************************************************/
60 /*****************************************************************************
61 * Static functions
62 ******************************************************************************/
67 * Test new textures in the routines that follow.
70 /*****************************************************************************
72 * FUNCTION
74 * pattern1
76 * INPUT
78 * OUTPUT
80 * RETURNS
82 * AUTHOR
84 * POV-Ray Team
86 * DESCRIPTION
88 * The pattern routines take an x,y,z point on an object and a pointer to
89 * the object's texture description and return the color at that point
90 * Similar routines are granite, agate, marble. See txtcolor.c for examples.
92 * CHANGES
94 ******************************************************************************/
96 DBL pattern1 (VECTOR EPoint, TPATTERN *TPat)
98 DBL value;
99 /* YOUR NAME HERE */
101 TPat=TPat;
103 value = Noise(EPoint);
105 return(value);
111 /*****************************************************************************
113 * FUNCTION
115 * pattern2
117 * INPUT
119 * OUTPUT
121 * RETURNS
123 * AUTHOR
125 * POV-Ray Team
127 * DESCRIPTION
129 * The pattern routines take an x,y,z point on an object and a pointer to
130 * the object's texture description and return the color at that point
131 * Similar routines are granite, agate, marble. See txtcolor.c for examples.
133 * CHANGES
135 ******************************************************************************/
137 DBL pattern2 (VECTOR EPoint, TPATTERN *TPat)
139 DBL value;
140 /* YOUR NAME HERE */
141 TPat=TPat;
143 value = Noise(EPoint);
145 return(value);
152 /*****************************************************************************
154 * FUNCTION
156 * pattern3
158 * INPUT
160 * OUTPUT
162 * RETURNS
164 * AUTHOR
166 * POV-Ray Team
168 * DESCRIPTION
170 * The pattern routines take an x,y,z point on an object and a pointer to
171 * the object's texture description and return the color at that point
172 * Similar routines are granite, agate, marble. See txtcolor.c for examples.
174 * CHANGES
176 ******************************************************************************/
178 DBL pattern3 (VECTOR EPoint, TPATTERN *TPat)
180 DBL value;
181 /* YOUR NAME HERE */
182 TPat=TPat;
184 value = Noise(EPoint);
186 return(value);
192 /*****************************************************************************
194 * FUNCTION
196 * bumpy1
198 * INPUT
200 * OUTPUT
202 * RETURNS
204 * AUTHOR
206 * POV-Ray Team
208 * DESCRIPTION
210 * The bumpy routines take a point on an object, a pointer to the
211 * object's texture description and the surface normal at that point and
212 * return a peturb surface normal to create the illusion that the surface
213 * has been displaced.
215 * Similar routines are ripples, dents, bumps. See txtbump.c for examples.
217 * CHANGES
219 ******************************************************************************/
221 void bumpy1 (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
223 /* YOUR NAME HERE */
224 EPoint=EPoint;
226 Tnormal = Tnormal;
228 Assign_Vector(normal, normal);
233 /*****************************************************************************
235 * FUNCTION
237 * bumpy2
239 * INPUT
241 * OUTPUT
243 * RETURNS
245 * AUTHOR
247 * POV-Ray Team
249 * DESCRIPTION
251 * The bumpy routines take a point on an object, a pointer to the
252 * object's texture description and the surface normal at that point and
253 * return a peturb surface normal to create the illusion that the surface
254 * has been displaced.
256 * Similar routines are ripples, dents, bumps. See txtbump.c for examples.
258 * CHANGES
260 ******************************************************************************/
262 void bumpy2 (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
264 /* YOUR NAME HERE */
265 EPoint=EPoint;
267 Tnormal = Tnormal;
269 Assign_Vector(normal, normal);
274 /*****************************************************************************
276 * FUNCTION
278 * bumpy3
280 * INPUT
282 * OUTPUT
284 * RETURNS
286 * AUTHOR
288 * POV-Ray Team
290 * DESCRIPTION
292 * The bumpy routines take a point on an object, a pointer to the
293 * object's texture description and the surface normal at that point and
294 * return a peturb surface normal to create the illusion that the surface
295 * has been displaced.
297 * Similar routines are ripples, dents, bumps. See txtbump.c for examples.
299 * CHANGES
301 ******************************************************************************/
303 void bumpy3 (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
305 /* YOUR NAME HERE */
306 EPoint=EPoint;
308 Tnormal = Tnormal;
310 Assign_Vector(normal, normal);