| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311 |
- /****************************************************************************
- * txttest.c
- *
- * This module implements "fill-in-the-blank" pre-programmed texture
- * functions for easy modification and testing. Create new textures here.
- *
- * from Persistence of Vision(tm) Ray Tracer
- * Copyright 1996,1999 Persistence of Vision Team
- *---------------------------------------------------------------------------
- * NOTICE: This source code file is provided so that patterns may experiment
- * with enhancements to POV-Ray and to port the software to platforms other
- * than those supported by the POV-Ray Team. There are strict rules under
- * which you are permitted to use this file. The rules are in the file
- * named POVLEGAL.DOC which should be distributed with this file.
- * If POVLEGAL.DOC is not available or for more info please contact the POV-Ray
- * Team Coordinator by email to team-coord@povray.org or visit us on the web at
- * http://www.povray.org. The latest version of POV-Ray may be found at this site.
- *
- * This program is based on the popular DKB raytracer version 2.12.
- * DKBTrace was originally written by David K. Buck.
- * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
- *
- *****************************************************************************/
- /*
- * Some texture ideas garnered from SIGGRAPH '85 Volume 19 Number 3,
- * "An Image Synthesizer" By Ken Perlin.
- *
- * Further Ideas Garnered from "The RenderMan Companion" (Addison Wesley)
- */
- #include "frame.h"
- #include "vector.h"
- #include "povproto.h"
- #include "texture.h"
- #include "povray.h" /* [DB 9/94] */
- #include "txttest.h" /* [DB 9/94] */
- #include "pattern.h" /* [CY 10/94] */
- /*****************************************************************************
- * Local preprocessor defines
- ******************************************************************************/
- /*****************************************************************************
- * Local typedefs
- ******************************************************************************/
- /*****************************************************************************
- * Local variables
- ******************************************************************************/
- /*****************************************************************************
- * Static functions
- ******************************************************************************/
- /*
- * Test new textures in the routines that follow.
- */
- /*****************************************************************************
- *
- * FUNCTION
- *
- * pattern1
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * POV-Ray Team
- *
- * DESCRIPTION
- *
- * The pattern routines take an x,y,z point on an object and a pointer to
- * the object's texture description and return the color at that point
- * Similar routines are granite, agate, marble. See txtcolor.c for examples.
- *
- * CHANGES
- *
- ******************************************************************************/
- DBL pattern1 (VECTOR EPoint, TPATTERN *TPat)
- {
- DBL value;
- /* YOUR NAME HERE */
- TPat=TPat;
- value = Noise(EPoint);
- return(value);
- }
- /*****************************************************************************
- *
- * FUNCTION
- *
- * pattern2
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * POV-Ray Team
- *
- * DESCRIPTION
- *
- * The pattern routines take an x,y,z point on an object and a pointer to
- * the object's texture description and return the color at that point
- * Similar routines are granite, agate, marble. See txtcolor.c for examples.
- *
- * CHANGES
- *
- ******************************************************************************/
- DBL pattern2 (VECTOR EPoint, TPATTERN *TPat)
- {
- DBL value;
- /* YOUR NAME HERE */
- TPat=TPat;
- value = Noise(EPoint);
- return(value);
- }
- /*****************************************************************************
- *
- * FUNCTION
- *
- * pattern3
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * POV-Ray Team
- *
- * DESCRIPTION
- *
- * The pattern routines take an x,y,z point on an object and a pointer to
- * the object's texture description and return the color at that point
- * Similar routines are granite, agate, marble. See txtcolor.c for examples.
- *
- * CHANGES
- *
- ******************************************************************************/
- DBL pattern3 (VECTOR EPoint, TPATTERN *TPat)
- {
- DBL value;
- /* YOUR NAME HERE */
- TPat=TPat;
- value = Noise(EPoint);
- return(value);
- }
- /*****************************************************************************
- *
- * FUNCTION
- *
- * bumpy1
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * POV-Ray Team
- *
- * DESCRIPTION
- *
- * The bumpy routines take a point on an object, a pointer to the
- * object's texture description and the surface normal at that point and
- * return a peturb surface normal to create the illusion that the surface
- * has been displaced.
- *
- * Similar routines are ripples, dents, bumps. See txtbump.c for examples.
- *
- * CHANGES
- *
- ******************************************************************************/
- void bumpy1 (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
- {
- /* YOUR NAME HERE */
- EPoint=EPoint;
- Tnormal = Tnormal;
- Assign_Vector(normal, normal);
- }
- /*****************************************************************************
- *
- * FUNCTION
- *
- * bumpy2
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * POV-Ray Team
- *
- * DESCRIPTION
- *
- * The bumpy routines take a point on an object, a pointer to the
- * object's texture description and the surface normal at that point and
- * return a peturb surface normal to create the illusion that the surface
- * has been displaced.
- *
- * Similar routines are ripples, dents, bumps. See txtbump.c for examples.
- *
- * CHANGES
- *
- ******************************************************************************/
- void bumpy2 (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
- {
- /* YOUR NAME HERE */
- EPoint=EPoint;
- Tnormal = Tnormal;
- Assign_Vector(normal, normal);
- }
- /*****************************************************************************
- *
- * FUNCTION
- *
- * bumpy3
- *
- * INPUT
- *
- * OUTPUT
- *
- * RETURNS
- *
- * AUTHOR
- *
- * POV-Ray Team
- *
- * DESCRIPTION
- *
- * The bumpy routines take a point on an object, a pointer to the
- * object's texture description and the surface normal at that point and
- * return a peturb surface normal to create the illusion that the surface
- * has been displaced.
- *
- * Similar routines are ripples, dents, bumps. See txtbump.c for examples.
- *
- * CHANGES
- *
- ******************************************************************************/
- void bumpy3 (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
- {
- /* YOUR NAME HERE */
- EPoint=EPoint;
- Tnormal = Tnormal;
- Assign_Vector(normal, normal);
- }
|