Re: info-performer Aug 26 1999

New Message Reply Date view Thread view Subject view Author view

Larry Ramey (ramey++at++ccpo.odu.edu)
Fri, 27 Aug 1999 09:34:41 -0400


>-
>
> ******************************************************************************
>
> From: Neil Witcomb <NWITCOMB++at++mdrobotics.ca>
> Date: Thu, 26 Aug 1999 16:15:33 -0400
> Subject: User Engines
>
> ** High Priority **
>
> In this code at the end in the engine section there is a variable 'd' which comes from the destination. If this infact a float or a pfVec3. At the end I have cut a lot out of this program but there is d[0], d[1], d[2], which is something which can't be done with a float. So am I acting on the pfVec or am I acting on each element in the pfVec3 each pass.
>
>

Neil,

#1) const float& pfVec3::operator [](int i);
if you don't understand what this operator is returning (C++ API) then I
would suggest a basic C++ text under the chapter operator overloading.

#2) "At the end I have cut a lot out of this program but there is d[0],
d[1], d[2], which is something which can't be done with a float. "

That is true, but d isn't cast as a float, it is cast as a float*.
<Scratches head, looks around, blinks twice>

#3) As for the Enigine question, Just yesterday Yasir put a pretty good
explanation of how Engines and fluxes work together, if you didn't get
it I'll bet we would try to explain again if asked... I know I wouldn't
mind hearing one more time how those darn things are supposed to be
used.

> // Initialization
> flux_coords = new pfFlux(sizeof(pfVec3) * 3, PFFLUX_DEFAULT_NUM_BUFFERS);
> flux_coords->initData(coords);
>
> flux_control = new pfFlux(sizeof(float) * 3, PFFLUX_DEFAULT_NUM_BUFFERS);
> flux_control->setMode(PFFLUX_PUSH, PF_ON);
>
> user_engine = new pfEngine(PFENG_USER_FUNCTION);
> user_engine->setUserFunction(my_mult_engine);
> user_engine->setSrc(0, coords, NULL, 0, 0, 3);
> user_engine->setSrc(1, flux_control, NULL, 0, 0, 0);
> user_engine->setIterations(3, 3);
> user_engine->setDst(flux_coords, NULL, 0, 3);
>
> // Engine Code
> eng->getDst(&dst, &d_ilist, &d_offset, &d_stride);
> eng->getSrc(0, &src0, &s_ilist0, &s_icount0, &s_offset0, &s_stride0);
>
> eng->getIterations(&iterations, &items);
>
> d = (float*)((pfFlux*)dst)->getWritableData();
> if (d == NULL) return;
>
> // s0, s1 is the source information
>
> for (i = 0; i < iterations; i++)
> {
> for (j = 0; j < items; j++) d[j] = s0[j] * s1[j];
> d += d_stride;
> s0 += s_stride0;
> s1 += s_stride1;
> }
>
>
>

-- 
---------------------------------------------------------------
Larry E. Ramey  ramey++at++ccpo.odu.edu 
757-683-3439 (CAVE)   757-683-5335 (VEL Lab)
"I eat weirder things than you in my cereal" - Zaphod Bebblebrox
"Maybe life is like a ride on a freeway/
dodgeing bullets while your trying to find your way" - Offspring

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Fri Aug 27 1999 - 06:34:51 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.