AlexGaida / aimNode

Basic Aim Node C++ Plugin using CMake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

aimNode


Information:

Basic Aim Node C++ Plugin using CMake

Purpose:

To save the configuration and build settings of CMake files.

The Plugin:

Basically an aim vector pointer. Using normalized Vectors.

Math:

_MVector_ z_vec = forwardData.asVector();
z_vec *= -1;
upVector.normalize();
z_vec.normalize();

_MVector_ x_vec = z_vec ^ upVector;
x_vec.normalize();
_MVector_ y_vec = x_vec ^ z_vec;
y_vec.normalize();

building the matrix

_double_ MyMatrix[4][4] = { {x_vec.x, x_vec.y, x_vec.z, 0},
                            {y_vec.x, y_vec.y, y_vec.z, 0},
                            {z_vec.x, z_vec.y, z_vec.z, 0},
                            {0.0, 0.0, 0.0, 1.0}
                          };

MEL setup

loadPlugin "aimNode.mll";
createNode "aimNode";
createNode "locator" -n "aimAtShape";
createNode "locator" -n "aimShape";
connectAttr "aimAt.translate" "aimNode1.forward";
connectAttr "aimNode1.or" "aim.r";
setAttr aimAt.translate -type "double3" 1.0 0.0 0.0;

Demo:

Node Demo

Resources used

Autodesk Maya C++ Reference Documentation: http://help.autodesk.com/view/MAYAUL/2019/ENU/?guid=Maya_SDK_MERGED_cpp_ref_build_rotation_node_2build_rotation_node_8cpp_example_html

About

Basic Aim Node C++ Plugin using CMake


Languages

Language:C++ 61.7%Language:CMake 35.6%Language:Batchfile 2.7%