Difference between pages "Recursion" and "ReturnNVectorCOG"

From scripting
(Difference between pages)
Jump to: navigation, search
(Created page with " <div align="right">Back to Academic_Archives.</div> __TOC__ ===In Progress=== ===Important Links=== [http://www.idi.ntnu.no/~fredrior/files/Catmull-Clark%201978%20Re...")
 
(Created page with " global proc vector ReturnNVectorCOG(vector $AllVecs[]) { //Author Nick Pisca 0001d 2010 //$AllVecs[0]=<<0,0,0>>;$AllVecs[1]=<<1,-1,0>>;$AllVecs[2]=<<1,0,0>>;$AllVecs[3]=<...")
 
Line 1: Line 1:
 +
global proc vector ReturnNVectorCOG(vector $AllVecs[]) {
 +
//Author Nick Pisca 0001d 2010
 +
//$AllVecs[0]=<<0,0,0>>;$AllVecs[1]=<<1,-1,0>>;$AllVecs[2]=<<1,0,0>>;$AllVecs[3]=<<0,0,2>>;
 +
vector $TempVec = <<0,0,0>>;
 +
if (size($AllVecs) != 0 ) {
 +
for ($i=0;$i<size($AllVecs);$i++) {
 +
$TempVec = $TempVec + $AllVecs[$i];
 +
}
 +
$TempVec = $TempVec / size($AllVecs);
 +
}
 +
return $TempVec;
 +
}
  
<div align="right">Back to [[Academic_Archives]].</div>
 
__TOC__
 
  
===In Progress===
 
  
  
 
+
''More information on vectors and vector mathematics, read pages 14-16, 20-21 in [http://stores.lulu.com/nickpisca YSYT].
===Important Links===
+
[[Category:MEL]]
 
 
[http://www.idi.ntnu.no/~fredrior/files/Catmull-Clark%201978%20Recursively%20generated%20surfaces.pdf E. Catmull and J. Clark: Recursively generated B-spline surfaces on arbitrary topological surfaces, Computer-Aided Design 10(6):350-355 (November 1978)] (proto-subdivision surfaces).
 
 
 
===Posted Projects===
 
 
 
'''MEL Scripts:'''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<div align="right">Back to [[Academic_Archives]].</div>
 

Latest revision as of 19:56, 24 April 2017

global proc vector ReturnNVectorCOG(vector $AllVecs[]) {
	//Author Nick Pisca 0001d 2010
	//$AllVecs[0]=<<0,0,0>>;$AllVecs[1]=<<1,-1,0>>;$AllVecs[2]=<<1,0,0>>;$AllVecs[3]=<<0,0,2>>;
	vector $TempVec = <<0,0,0>>;
	if (size($AllVecs) != 0 ) {
		for ($i=0;$i<size($AllVecs);$i++) {
			$TempVec = $TempVec + $AllVecs[$i];
		}
		$TempVec = $TempVec / size($AllVecs); 
	}
	return $TempVec;
}



More information on vectors and vector mathematics, read pages 14-16, 20-21 in YSYT.