<CsoundSynthesizer>
<CsOptions>

-+Y ;*** no audio

</CsOptions>
<CsInstruments>
#include "OpenGL.h"

	sr = 100
	kr = 100
	ksmps = 1
	nchnls = 1
	$glFPS(40)

	$glSCREEN

	$glPERSPECTIVE(90)
	glClearColor	0,0,0,1

	$glLIGHTING
	glColor3	.5,.7,.8

	glEnable	$GL_DEPTH_TEST	
	glEnable	$GL_CULL_FACE	
GLinsert_i $GL_NOT_VALID

	$glCLEAR
GLinsert_i 1


gi1	ftgen	1,0,256,19,1,1,0,1
gi10	ftgen	10,0,256,10,1


;///////////////////////////////////////////////////
	instr	1
;///////////////////////////////////////////////////


t1	GLoscili	1,giFPS/.09,gi1,.75
t2	GLoscili	1,giFPS/.023456,gi1
t3	GLoscili	1,giFPS/.0153456,gi1
t4	GLoscili	1,giFPS/.093215,gi10

	glLightv  $GL_LIGHT0, $GL_AMBIENT, t1*.5, t1*.5, t1, 1
	glLightv  $GL_LIGHT0, $GL_DIFFUSE, t4*.5, t4*.5, t4*.5, 1
	glLightv  $GL_LIGHT0, $GL_SPECULAR, t3, t3, t3, 1

	glLoadIdentity
	glTranslate	0,0,-3
	glPushMatrix
	glRotate		t1*360,1,1,0
	glRotate		t3*360,1,0,0

tmode	=	(t4>0) ? $GL_FLAT : $GL_SMOOTH
trings	=	(t4>0) ? 15: 50
tfaces	=	(t4>0) ? 10: 40
	glShadeModel (tmode)

	glutTorus	.5,  1,  tfaces,   trings, 1
	glPopMatrix

GLinsert	1.1
	endin



</CsInstruments>
<CsScore>

i1 .5 3600 1

</CsScore>
</CsoundSynthesizer>
