Bill Balloni (m218822++at++fltsim.MDC.COM)
Wed, 2 Nov 1994 09:14:52 -0600 (CST)
I took the simple.c file and grafted on the pfuSmoke stuff. Below is
a summary of my additions.
Is there anyone who can see an obvious problem with these additions or
how I am doing the smoke? Let me know if you do. Also, if anyone has
any working sample code which uses pfuSmoke I would be most grateful
for a look :^)
Thanks,
Bill Balloni McDonnell Douglas Aerospace St. Louis, MO
Flight Simulation Laboratory
email: balloni++at++fltsim.MDC.COM
phone: (314) 234-0944
*** SIMPLE.C ***
...
#include "pfutil.h"
static pfuSmoke * mtail; /* a missile tail */
static pfVec3 * mtail_eye;
...
main (int argc, char *argv[])
{
...
pfVec3 mtail_org;
...
/* Initialize Performer */
pfInit();
/* Use default multiprocessing mode based on number of
* processors.
*/
pfMultiprocess(PFMP_DEFAULT);
/* Let's see some smoke */
pfuInitSmokes ();
/* Configure multiprocessing mode and start parallel
* processes.
*/
pfConfig();
/* Make a new smoke and configure it */
mtail = pfuNewSmoke ();
pfuSmokeType (mtail, PFUSMOKE_EXPLOSION);
pfSetVec3 (mtail_org, 0.0f, 0.0f, 0.0f);
pfuSmokeOrigin (mtail, mtail_org, 500.0f);
pfuSmokeDuration (mtail, 20.0f);
pfuSmokeMode (mtail, PFUSMOKE_START);
...
pfChanDrawFunc (chan, draw_callback);
/* Allocate a buffer for the draw callback */
mtail_eye = (pfVec3 *) pfAllocChanData (chan, sizeof (pfVec3));
...
/* Simulate for twenty seconds. */
while (t < 20.0f)
{
...
/* Copy the eyepoint for the draw callback into the pipeline. */
pfCopyVec3 (*mtail_eye, view.xyz);
pfPassChanData (chan);
...
}
/*
* Channel draw callback function.
*/
static void
draw_callback (pfChannel *chan, void *data)
{
/* Clear the channel */
pfClearChan (chan); /* e.g. - clear the viewport */
pfuDrawSmokes (*mtail_eye);
pfDraw(); /* Render the frame */
}
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:38 PDT