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

Ivan DeWolf ivan at martian-labs.com
Tue Oct 25 13:32:54 EDT 2005

sounds a bit off track.
Generally you don't need to create geometry. If you need a million points, put
down a gtrid SOP (polygons) and set it to be 1 by 1000000 and you have a
million points. Use an add SOP to remove geometry and keep points, if you
Then set the point positions with a point SOP or a custom vex SOP. no need to
create points in vex, just change their positions and/or attributes.
You might need to create geometry if you are building odd polygon connections or
something, then you dig into the HDK.

Quoting Dave Nunez <nunezd at gmail.com>:

> 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,
> Dave
> --
> When things get too complicated, it sometimes makes sense to stop and
> wonder: Have I asked the right question?
> -Enrico Bombieri
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list


"Perfection is achieved when nothing else can be removed"
-Yvon Chouinard

More information about the Sidefx-houdini-list mailing list