Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Color and dimensions of ofSpherePrimitive

$
0
0

@Kaito_Kid wrote:

I am creating primitives using user input for the atributes (location, size, color, etc).

I could easily make a prism, using the following code

ofBoxPrimitive* box = new ofBoxPrimitive();
box->set(w, h, d);
box->setPosition(x, y, z);
//box->rotate(rand() % 360, 1.0, 0.0, 0.0);
//box->rotate(rand() % 360, 0, 1.0, 0.0);
//box->rotate(rand() % 360, 0, 0.0, 1.0);
for (int i = 0; i < 6; i++)
{
    box->setSideColor(i, fillCol);
}

But as for the ofSpherePrimitive, I can't find how to set the color to something else than white, and the size to something irregular (like a 3D ellipse? I don't know what's the word).

I figured out I should use textures to give the sphere a color, but I can't get it to work.

What is the recommended method to color and stretch an ofSpherePrimitive, or should I use another tye of object entirely? If yes, which one?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles