Jump to content

cummulate a value in vops


kubabuk

Recommended Posts

Hi all,

I'm having problems figuring out how to put that in vops, any help will be very appreciated.

Thanks,

kuba

Hi, Kuba!

don't know what you exactly mean, but..

calculating center of the object vop.

sop center()
{
	vector center = {0, 0, 0};
	vector q = {0, 0, 0};
	int i = 0;
	for (i = 0; i < Npt; i ++)
	{
		import ("P", q, 0, i);
		center += q/Npt;
	}
	P = center;
}

Link to comment
Share on other sites

Thanks mic,

The aim is to measure on the line distance between consecutive points and then sum up that values from currently processed point to point 0. This requires to somehow accumulate measured distance. I'm just wondering maybe I'm in a wrong scripting context, since VEX has a SIMD architecture....

kuba

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...