examples/Simple/Simple.cpp
/**
 * In setup, we will draw two cubes with different colors and initial transformations. 
*/
In setup, we will draw two cubes with different colors and initial transformations.
In setup we will draw two cubes with different colors and initial transformations .
void Simple::setup()
{
	setFrameRate(30);
	gl::enableVerticalSync();
	gl::enableDepthRead();
	gl::enableDepthWrite();
	mCam.lookAt( vec3( -15, -5, -2 ), vec3( 0, 0.5f, 0 ) );
	gl::GlslProgRef shader = gl::getStockShader( gl::ShaderDef().lambert().color() );
	geom::SourceMods slice = geom::Cube();
	SimulationObject cube(slice, shader); 
	this->simulationObjectsMap["cube"] = cube;
	 for cube2
	SimulationObject cube2(slice >> geom::Translate(ci::vec3(0, 2, 0)), shader);
	Color redColor = Color( CM_RGB, 1, 0, 0 );
	cube2.color = redColor;
	this->simulationObjectsMap["cube2"] = cube2;
}
void Simple :: setup ( ) { setFrameRate ( 30 ) ; gl :: enableVerticalSync ( ) ; gl :: enableDepthRead ( ) ; gl :: enableDepthWrite ( ) ; mCam . lookAt ( vec3 ( -15 , -5 , -2 ) , vec3 ( 0 , 0.5f , 0 ) ) ; gl :: GlslProgRef shader = gl :: getStockShader ( gl :: ShaderDef ( ) . lambert ( ) . color ( ) ) ; geom :: SourceMods slice = geom :: Cube ( ) ; SimulationObject cube ( slice , shader ) ; this -> simulationObjectsMap [ " " ] = cube ; SimulationObject cube2 ( slice >> geom :: Translate ( ci :: vec3 ( 0 , 2 , 0 ) ) , shader ) ; Color redColor = Color ( CM_RGB , 1 , 0 , 0 ) ; cube2 . color = redColor ; this -> simulationObjectsMap [ " " ] = cube2 ; }
In setup, we will draw two cubes with different colors and initial transformations.
In setup we will draw two cubes with different colors and initial transformations .
/***** GUI Settings *****/ // setFullScreen(true); // enable Z-buffering to make shapes smoother around the edges https://libcinder.org/docs/guides/opengl/part2.html // Setup our default camera /***** Create Cubes *****/ // generate stock color shader // create a cube // apply modifiers and initialize a new SimulationObject // second argument defaults to the stock shader. // add the SimulationObject to a map so we can retreive it by name // apply modifiers and initialize a new SimulationObject for cube2 // add the SimulationObject to a map so we can retreive it by name