Function to return location of intersect with poly mesh and spherical object moving in the positive direction on the Y axis. Removing print()’s increases script speed enormously.

mel source

global proc int setSphereMeshIntersect(string $sphere, string $mesh, float $radius)
{
	int $iter = 100;

	float $limit[3] = {0.0, 2.5, 0.0};
	float $startPos[3] = {0.0, 0.0, 0.0};
	float $curPos[3] = {0.0, 0.0, 0.0};
	$curPos[0] = getAttr ($sphere + ".translateX");
	$curPos[2] = getAttr ($sphere + ".translateZ");

	$cpomNode = "cpom";

	for ($i = 0; $i <= $iter; $i++)
	{
		$shape = `listRelatives -shapes $mesh`;

		createNode -n $cpomNode closestPointOnMesh;
        	connectAttr -f ($shape[0] + ".outMesh") ($cpomNode + ".inMesh");
        	setAttr ($cpomNode + ".inPosition") $curPos[0] $curPos[1] $curPos[2];
		$cpom = `getAttr ($cpomNode + ".position")`;
		delete $cpomNode;

        	if ( pointDist($curPos, $cpom) <= $radius) {
			return 1;
        	}

        	$curPos[1] = $startPos[1] + ($limit[1]) / $iter * $i;
		setAttr ($sphere + ".translateY") $curPos[1];
	}
	return 0;
}

global proc float pointDist(float $p1[], float $p2[])
{
	return sqrt(
		(($p1[0] - $p2[0]) * ($p1[0] - $p2[0])) +
		(($p1[1] - $p2[1]) * ($p1[1] - $p2[1])) +
		(($p1[2] - $p2[2]) * ($p1[2] - $p2[2])));
}


result


Pronounce spike in Earth’s magnetic field on May 27, 09. Jupiter, Neptune, and Chiron were in alignment that day as well.

Graphics software coded to animate visuals displayed on an LCD screen under layer of practical stop animation for a conference opener. The software has to the ability to add/remove any number of shapes, change rotation, blend modes, flow speed (they animate), number of shape sides, segments, foreground/background/stroke colors, alpha, stroke weight, camera focal length, depth, and other visual controls.




documentation, download
source (processing)

key commands

  • TAB : toggle console
  • / : add shape
  • SPACE : toggle current shape
  • q w e r t y u i o p : global edit modes (use mouse drag to edit)
  • a s d f g h j k l : object edit modes (use mouse drag to edit)
  • = + : add / subtract shape sides
  • \ : Toggle OpenGL Blending
  • [ ] : cycle through OpenGL Blend Modes



links

link 1
link 2

animation curves of 1400 simultaneous servo movements for project prototype


view archived work at http://gabrieldunne.com/archive

note: each line in a MakeFile is executed in a unique shell. Commands that are relative must be on the same line.

do:
    cd ../
    ls -al

is not equal to:

do:
    cd ../; ls -al