Skip to content

RAM API Reference Graphics

Johann Diedrick edited this page Feb 4, 2015 · 16 revisions

Graphics

Summary

The RAMDanceToolkit has a number of global methods for drawing shapes, as defined in ramGraphics.h.

Table of Contents

ramGraphics


void ramBox(const ramNode& o, float size)

This method works in much the same way as ofBox, with additional support for collision detection.

An example of how collision detection works is available in the SoundCube.h scene in the RAMDanceToolkit.


void ramSphere(const ramNode& o, float radius)

This method works in much the same way as ofSphere, with additional support for collision detection.

An example of how collision detection works is available in the SoundCube.h scene in the RAMDanceToolkit.


void ramDrawBasicActor(const ramActor& actor)

This method draws a ramActor object using simple shapes.


void ramDrawBasicRigid(const ramRigidBody& rigid)

This method draws a ramRigidBody object using simple shapes.


void ramDrawNodes(const ramNodeArray& nodeArray)

This method draws a ramNodeArray object using simple shapes. You can use this method when you need to check whether an object is a ramNodeArray, ramActor or ramRigidBody.


void ramDrawNodeCorresponds(const ramNodeArray &a, const ramNodeArray &b)

This method draws lines between the corresponding nodes. Two ramNodeArrays must have same number of nodes.


void ramStripe(...)

This method draws a plane using a vector of ramNode objects.
vector<ramNode> or many ramNode objects can be passed as argument:

// vector
vector<ramNode> nodes;
nodes.push_back(some_node1);
nodes.push_back(some_node2);
nodes.push_back(some_node3);
ramStripe(nodes);

// ramNode (min:5, max:12)
ramStripe(some_node1, some_node2, some_node3, some_node4, some_node5, … some_node12);


ramSimpleShadow

By wrapping your graphics between ramBeginShadow() and ramEndShadow(), you can draw shadows on the floor.


void ramBeginShadow()

This method starts drawing shadows.


void ramBeginShadow()

This method ends drawing shadows.


void ramSetShadowAlpha(float alpha)

This method sets shadow alpha.


void ramSetShadowAlpha(float alpha)

This method sets shadow alpha.


void ramEnableShadow(bool v = true)

This method sets shadow alpha.



ramColor

The following colors are available:

ramColor::RED_NORMAL, ramColor::RED_DEEP, ramColor::RED_LIGHT, ramColor::GREEN_NORMAL, ramColor::GREEN_DEEP, ramColor::GREEN_LIGHT, ramColor::BLUE_NORMAL, ramColor::BLUE_DEEP, ramColor::BLUE_LIGHT, ramColor::YELLOW_NORMAL, ramColor::YELLOW_DEEP, ramColor::YELLOW_LIGHT, ramColor::BLACK, ramColor::DARK_GRAY, ramColor::GRAY, ramColor::LIGHT_GRAY, ramColor::WHITE, ramColor::DARK_GRAY_ALPHA, ramColor::GRAY_ALPHA, ramColor::LIGHT_GRAY_ALPHA, ramColor::SHADOW.

For example:

// ramColor::RED_NORMAL returns ofColor::fromHex(0xff6666)
ofSerColor( ramColor::RED_NORMAL );


ramGraphView



ramNodeLine


Creative Commons License
This Document by YCAM InterLab, Yoshito Onishi, Satoru Higa, Motoi Shimizu, and Kyle McDonald is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Clone this wiki locally