|
Prisms Development Toolkit DocumentationSide Effects Software Inc. 1997 |
#include <custom.h> /* you must have this! */
.
. omitted SOP code
.
static void
sopCook(SOP *sop)
{
SOP_DATA *sb;
OBJECT *obp;
char *expanded;
int idx;
PolyDetail *sourcePdp;
PolyPointPointer tmppt;
int npts;
/* first, some housekeeping */
sb = (SOP_DATA *)sop->special;
if (sop->pdp)
FreePolyDetail(sop->pdp);
sop->pdp = 0;
/* Then read in any source geometry */
GETSOURCE(sourcePdp, sop, 0, "Invalid source SOP");
/* Always copy the input and modify the copy, never the source */
sop->pdp = PolyCopyDetail(sourcePdp);
/* Next, use either EVALUATE or EVALUATEV to get the values of
the SOP input fields */
EVALUATELV(sop, sb->Single);
/*
* There are macros used to traverse lists. Here, we multiply each
* point's (x,y,z) values by 0.5. You will probably do something
* more useful.
*/
FOR_ALL_POINTS(sop->pdp->ppt, tmppt, npts)
{
tmppt->pos.x *= 0.5;
tmppt->pos.y *= 0.5;
tmppt->pos.z *= 0.5;
}
/* here is another macro to clear the normals of the SOP data */
CLEARSOPNML(sop)
}
Macros available to the programmer
Subroutines available
Expression Functions |
User Functions |
Custom SOPs
Prisms Internal Format |
Programmer's Reference
Compiling SOPs |
Using sopbuild |
SOP Routine Reference
Dynamic SOPs |
Prisms Types |
Macros
Math Routines |
Data Routines |
Polygon Routines |
Winged-edge Routines
477 Richmond Street West, Toronto, Ontario, Canada M5V 3E7