Esempio n. 1
0
void init() {
	// Load shaders and use the resulting shader program
    GLuint drawProg = InitShader("Draw.vertex", "Draw.fragment");
	GLuint shadowProg = InitShader("ShadowMap.vertex", "ShadowMap.fragment");
    glUseProgram(drawProg);

	meshSetup(Global::red_opaque, 1.2);

	const mat4 projection = Perspective(Global::FOV, 1.0f, 0.0078125f, 16.0f) * 
		translate(0.0f, 0.0f, 0.75f) * scale(10.0f);

	Global::root = new RenderGraph(
		drawProg,
		shadowProg,
		*genIdyll(5, 1.2f),
		projection
	);
	Global::sun = new RenderGraph(
		drawProg,
		shadowProg,
		*genSun( translate(16.0 * Global::sunVec) * scale(0.4f) *
			rX(M_PI/2.0) ),
		projection
	);

	help();
}
Esempio n. 2
0
Image::Image(string filename, ofVec3f loc){
    this->loc = loc;
    type = "Image"; returnType();
    image.load(filename);
//    image.mirror(true, false);
    cout << image.getImageType() << endl;
//    image.setImageType(OF_IMAGE_COLOR_ALPHA);
    size = ofVec2f(image.getWidth(), image.getHeight());
    loc = ofVec2f(0,0);
    
    meshSetup();
//    createFullScreenCopy();
}