My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
ofxMSAShape3D  

Featured
Updated Feb 4, 2010 by memosan

Create an instance of MSAShape3D, and then use the methods (check the header file for uptodate methods). e.g.:

 MSAShape3D myShape;
 

myShape.glBegin(GL_TRIANGLE_STRIP); myShape.glNormal(0, 0, 1); myShape.glColor(1, 0, 0); myShape.glTexCoord(0, 0); myShape.glVertex(0, 0, 0);

myShape.glColor(1, 1, 0); myShape.glTexCoord(1, 0); myShape.glVertex(100, 0, 0);

myShape.glColor(1, 0, 1); myShape.glTexCoord(0, 1); myShape.glVertex(0, 100, 0);

myShape.glColor(0, 1, 1); myShape.glTexCoord(1, 1); myShape.glVertex(100, 100, 0); myShape.glEnd();

List of all methods are:

 // reserve space for this many vertices
 // Not actually nessecary, arrays are resized automatically...
 // ... but reserving the size upfront improves performance
 void reserve(int reservedSize);
 

// similar to OpenGL glBegin // starts primitive draw mode void glBegin(GLenum drawMode); // similar to OpenGL glEnd() // sends all data to server to be drawn void glEnd(); // vertex position methods void glVertex(float x, float y, float z = 0); // x,y,z coordinates (if z is omitted, assumed 0) void glVertex3v(float *v); // pointer to x,y,z coordinates void glVertex2v(float *v); // pointer to x,y coordinates. z is assumed 0 // normal methods void glNormal(float x, float y, float z); // x,y,z components of normal void glNormal3v(float *v); // pointer to x,y,z components of normal

// color methods void glColor(float r, float g, float b, float a = 1); // r,g,b,a color components (if a is omitted, assumed 0) void glColor(int hexColor); // 0xFFFFFF hex color, alpha is assumed 1 void glColor3v(float *v); // pointer to r,g,b components. alpha is assumed 1 void glColor4v(float *v); // pointer to r,g,b,a components // texture coordinate methods void glTexCoord(float u, float v); // u,v texture coordinates void glTexCoord2v(float *v); // pointer to u,v texture coordinates


Sign in to add a comment
Powered by Google Project Hosting