Пример #1
0
/**
 * @brief Draws the GUI over the teapot, including the sliders and what-not.
 *
*/
void BoxesStage::drawGUI(void)
{
	//Change perspective to orthographic 2D
	changePerspective2D();

	//Ensure we can render fonts
	Fonts::init();

	//Draw information text in the middle
	Fonts::drawText(0.1f, 0.5f, "Now it's your turn! Click on the boxes below and drag left/right to change the intensity for each \"channel\".", Fonts::ALIGNMENT_LEFT);
	Fonts::drawText(0.1f, 0.5f - 0.025f, "Notice that when you change the intensity for one of these channels, it affects the resulting colour. When ", Fonts::ALIGNMENT_LEFT);
	Fonts::drawText(0.1f, 0.5f - 0.050f, "you are ready, click the \'Next\' button to continue the animation.", Fonts::ALIGNMENT_LEFT);

	//Draw the button to advance to the next stage
	drawButton(0.87f, 0.45f, "Next >");

	//Move initially (all translations are reset after this function runs)
	glTranslatef(0.15f, 0.2f, 0.0f);

	for (unsigned int i = 0; i < 3; i++)
	{
		//Run through each box. If we're on the first iteration, dont move, otherwise move right
		glTranslatef((i == 0) ? (0) : (0.20f), 0.0f, 0.0f);

		//Draw the last box with =
		if (i == 2)
			drawColorBox(r[i], g[i], b[i], a[i], "=", boxes[i]);

		//Otherwise, with +
		else
			drawColorBox(r[i], g[i], b[i], a[i], "+", boxes[i]);
	}

	//Translate once more and draw the resulting color box!
	glTranslatef(0.20f, 0.0f, 0.0f);
	drawFinalBox();
}
Пример #2
0
void NodeDatabrick::draw()
{
    //std::cout <<"direction=" << m_direction << ",ratio=" << m_ratio << "\n";
    //NodeDimension::draw();

    float color[4]={0.5, 0.5, 0.5, 0.5};
    //float color[4]={0., 0., 1., 0.5};
    //for(int i=0; i<3; i++) 
    //color[0] = 0.35*(0.5 - m_pos[0]);
    //color[1] = 0.5*(0.5 - m_pos[1]);
    //color[2] = 0.35*(0.5 + m_pos[2]);
    drawColorBox(get_scale(), get_pos(), color);

    //drawColorBox(get_scale(), get_pos(), 0);
    
}
Пример #3
0
void draw(RenderData *rd) {

    float c = rd->tick * 0.06;
    float c2 = rd->tick * 0.023;



    int i;
    int numBoxes = 20;

    for (i=0; i<numBoxes; i++) {

        float x = 700 + sin(c+(i*0.2))*500;
        float y = i*35;
        float z = i*0.3 + sin(c2)*2 - 2;

        drawColorBox(rd, 1,0,0,1, x,y,z, 50,200);
    }

}