Maya: 3D Math

From wikinotes

How Maya keeps track of objects in 3D space

In order for maya to keep track of the translations on objects, it creates two nodes per object:

ex:

pcube1				//this node is nothing but a single cartesian point

pucbe1Shape			//this node is a complex matrix that comprizes of each vertex
				//and I assume normals/connectivity


Every object's Shape is created around the point of origin in it's local space. Maya knows where to draw objects on screen by multiplying each vertex co-ordinate in the pcube1Shape node by the pcube1 node (just the translation point -- this is located at the pivot point of the object)


How Normals are determined

<img src='./x-ArtNotes_Media/3D%20Math/CrossProduct.gif' /> The *cross product* takes 2 Vectors and results in a third vector that is perpendicular to both pre-existing vectors.
<img src='./x-ArtNotes_Media/3D%20Math/VectorTripleProduct.gif' /> This is how vertex normals are determined. In the below example, the vertex normals (shown by -->) are the *Vector Triple Product*

I do not remember the relevance of this

How do you get a vector from a single Cartesian Point? (x,y,z) The vector's direction is found from the point of origin. Mathematically, that simplifies the 3rd point. In maya, the Origin is just the vertex from which you are determining the normal

<img src='./x-ArtNotes_Media/3D%20Math/CartesianPoint.gif' />


Number of Edges in a segment of a circle (pie)

Z = number of segments
{total # of edges in circle} = ({# edges in segment} * Z) - Z

Maintaining ObjectSize in relation to Camera

import math
dist = objectsize / math.tan(focalLength)