/**
 * @file
 * vuo.type.rotate.real.transform2d node implementation.
 *
 * @copyright Copyright © 2012–2015 Kosada Incorporated.
 * This code may be modified and distributed under the terms of the MIT License.
 * For more information, see http://vuo.org/license.
 */

#include "node.h"

VuoModuleMetadata({
					 "title" : "Convert Real to Rotation",
					 "keywords" : [ "rotate", "matrix", "trs", "angle", "roll", "axis" ],
					 "version" : "1.0.0"
				 });

void nodeEvent
(
		VuoInputData(VuoReal, {"default":0.0,"suggestedMin":0.0,"suggestedMax":360.0,"suggestedStep":15.0}) rotation,
		VuoOutputData(VuoTransform2d) transform
)
{
	// 2d transform stores rotation as a radian, and the constructor doesn't convert for ye'
	*transform = VuoTransform2d_make(VuoPoint2d_make(0,0), rotation * M_PI/180., VuoPoint2d_make(1,1));
}
예제 #2
0
 * @file
 * vuo.transform.make.2d node implementation.
 *
 * @copyright Copyright © 2012–2014 Kosada Incorporated.
 * This code may be modified and distributed under the terms of the MIT License.
 * For more information, see http://vuo.org/license.
 */

#include "node.h"

VuoModuleMetadata({
					 "title" : "Make 2D Transform",
					 "keywords" : [ "translation", "rotation", "scale", "shift", "move", "position",
						 "angle", "roll", "axis", "size", "grow", "shrink" ],
					 "version" : "1.0.0",
					 "node" : {
						  "exampleCompositions" : [ ]
					 }
				 });

void nodeEvent
(
		VuoInputData(VuoPoint2d, {"default":{"x":0.0,"y":0.0},"suggestedStep":{"x":0.1,"y":0.1}}) translation,
		VuoInputData(VuoReal, {"default":0.0,"suggestedMin":0.0,"suggestedMax":360.0,"suggestedStep":15.0}) rotation,
		VuoInputData(VuoPoint2d, {"default":{"x":1.0,"y":1.0},"suggestedStep":{"x":0.1,"y":0.1}}) scale,
		VuoOutputData(VuoTransform2d) transform
)
{
	*transform = VuoTransform2d_make(translation, rotation * M_PI/180., scale);
}
/**
 * @file
 * vuo.type.translate.point2d.transform2d node implementation.
 *
 * @copyright Copyright © 2012–2015 Kosada Incorporated.
 * This code may be modified and distributed under the terms of the MIT License.
 * For more information, see http://vuo.org/license.
 */

#include "node.h"

VuoModuleMetadata({
					 "title" : "Convert 2D Point to Translation",
					 "keywords" : [ "position", "matrix", "trs", "angle", "axis" ],
					 "version" : "1.0.0"
				 });

void nodeEvent
(
		VuoInputData(VuoPoint2d, {"default":{"x":1, "y":1}}) translation,
		VuoOutputData(VuoTransform2d) transform
)
{
	*transform = VuoTransform2d_make(translation, 0., VuoPoint2d_make(1,1));
}
/**
 * @file
 * vuo.type.scale.point2d.transform2d node implementation.
 *
 * @copyright Copyright © 2012–2014 Kosada Incorporated.
 * This code may be modified and distributed under the terms of the MIT License.
 * For more information, see http://vuo.org/license.
 */

#include "node.h"

VuoModuleMetadata({
					 "title" : "Convert 2D Point to Scale",
					 "keywords" : [ "matrix", "trs", "size", "angle", "axis", "grow", "shrink", "stretch" ],
					 "version" : "1.0.0"
				 });

void nodeEvent
(
		VuoInputData(VuoPoint2d, {"default":{"x":1, "y":1}}) scale,
		VuoOutputData(VuoTransform2d) transform
)
{
	*transform = VuoTransform2d_make(VuoPoint2d_make(0,0), 0., scale);
}