[Sidefx-houdini-list] vex sop for loop help

Dave Nunez nunezd at gmail.com
Mon Oct 24 23:56:13 EDT 2005

Hi there,

I am having great difficulties optimizing a for loop in vex and was
wondering if anybody had any ideas:

	for (i = 0; i < ptnum; i++)
	"custom function which calculates point positions x y z"
	out = vop_floattovec (x, y, z);
	P = out;

Since we can't use vex to generate geometry (please correct me if am
wrong), I am using an add sop, creating one point, appending a copy
sop and copying the point nth times.  The above for loop inside my vex
sop works, but very slowly.  I have tried
using Npt (for the end condition of the for loop), nesting the for
loop... and have run out of ideas.  The C implematation of the for
loop which generates a geo file is:

	for( loop=0; loop<=I; loop++)
      	fprintf( "%f %f %f 1 (%lf %lf %lf)\n", x, y, z, r, g, b);
      	"custom function which calculates point positions x y z and and
pt colors rgb"

I need this vex sop to compute a million + point positions, should I
be using vex for this ? or start learning HDK ? or stick to my C
implemantation to generate geo files?

Thanks in advance,

When things get too complicated, it sometimes makes sense to stop and
wonder: Have I asked the right question?
-Enrico Bombieri

More information about the Sidefx-houdini-list mailing list