<CsoundSynthesizer>
<CsOptions>

-+Y

</CsOptions>
<CsInstruments>
#include "OpenGL.h"

	$glHEADER
	$glFPS(30)
	$glPANEL(512' 512)


gi1	ftgen	1,0,256,19,1,1,0,1


;---> Start GL
	giTex1	GLloadTexture "fractal14.png", $PNG_ALPHA,$GL_REPEAT
	giTex3	GLloadTexture "fractal12.png", $PNG_ALPHA,$GL_REPEAT
	giTex2	GLloadTexture "nuvole.png", $PNG_ALPHA,$GL_REPEAT



	glEnable	$GL_COLOR_MATERIAL
	glEnable	$GL_TEXTURE_2D

	glBlendFunc	$GL_SRC_ALPHA, $GL_ONE_MINUS_SRC_ALPHA
	glClearColor	0,0,0,1

GLinsert_i $GL_INIT

	$glPERSPECTIVE(60)

GLinsert_i $GL_NOT_VALID

	$glCLEAR
GLinsert_i 1


;///////////////////////////////////////////////////
	instr	1
;///////////////////////////////////////////////////

iw	=	5
ih	=	5

t1	GLoscili	1,giFPS/.05,1,.75
t2	GLoscili	1,giFPS/.023456,1
t3	GLoscili	1,giFPS/.043215,1
;---> Start GL
	
	glLoadIdentity
	glTranslate	0,0,-5.5
	
	glPushMatrix
		;glRotate		t3*360,1,1,0
		glRotate		t1*360,0,0,1
		glDisable	$GL_BLEND	
		glBindTexture	giTex2
		glColor	.2,.2,.2,1
		glBegin	$GL_QUADS
			glTexCoord2	1, 1
			glVertex3		-iw, -ih, 0
			glTexCoord2	1, 0
			glVertex3		-iw,  ih, 0
			glTexCoord2	0, 0
			glVertex3		iw,  ih, 0
			glTexCoord2	0, 1
			glVertex3		iw, -ih, 0
	
		glEnd
	glPopMatrix

	glPushMatrix
		glTranslate	0,0,-1-(1-t3)*50
		glRotate		t1*360,0,0,1
;		glRotate		t2*360,1,0,0
		glBindTexture	giTex3
		glColor	1,1,1,1
		glEnable	$GL_BLEND
		glBegin	$GL_QUADS
			glTexCoord2	1, 1
			glVertex3		-iw, -ih, 0
			glTexCoord2	1, 0
			glVertex3		-iw,  ih, 0
			glTexCoord2	0, 0
			glVertex3		iw,  ih, 0
			glTexCoord2	0, 1
			glVertex3		iw, -ih, 0
	
		glEnd
	glPopMatrix

	glPushMatrix
		glTranslate	0,0,-.3-t3*100
		glRotate		-t3*360,0,0,1
		glRotate		t1*360,1,0,0
		glBindTexture	giTex1
		glColor	1,1,1,1
		glEnable	$GL_BLEND
		glBegin	$GL_QUADS
			glTexCoord2	1, 1
			glVertex3		-iw, -ih, 0
			glTexCoord2	1, 0
			glVertex3		-iw,  ih, 0
			glTexCoord2	0, 0
			glVertex3		iw,  ih, 0
			glTexCoord2	0, 1
			glVertex3		iw, -ih, 0
	
		glEnd
	glPopMatrix

GLinsert	1.1


	endin


</CsInstruments>
<CsScore>

i1 0 3600 1

</CsScore>
</CsoundSynthesizer>
