  uses glTransA

  'ARRAY OF MODEL VIEW MATRICES
  '
  %mmax 0x1000
  float matf[mmax*16] 'matrix array
  float vz[mmax]      'float array for z (translation)
  sys   midx[mmax]    'index for ascending-order of z

  sub scene(sys hWnd)
  ===================
  '
  PrepareSceneFrame
  StandardLighting li
  TranslucentMaterial  mt,0.5
  '
  'SETUP TEXTURE
  '
  static sys   imgn,res,wi,ht
  if not imgn
    imgn=21
    res=0 'use wi and ht of image
    LoadTexture "../../images/glass.jpg",imgn,res,wi,ht
  end if
  '
  '
  'GENERATE ARRAY OF TRANSFORMS
  float ang2,ang3
  sys   i,j,k
  sys   n=8
  float ang=360/n
  float d=tan(rad(90-ang/2))
  '
  j=0 : k=0
  for i=0 to <n
    ang2=i*ang
    ang3=ang1+ang2
    ' 
    loadidentity
    translatef   0,0,-7
    rotatef      20,1,0,0
    rotatef      ang3,0,1,0
    translatef   0,0,d
    savematrix   matf(j)
    '
    vz[k]=matf[j+14] 'COLLECT Z DISPLACEMENT
    j+=16 : k+=1
  next
  '
  sortindex(vz,midx,k) 'ARRANGE INTO ASCENDING Z ORDER
  '
  '
  'RENDER PANELS IN Z ORDER (FARTHEST FIRST)
  '
  texture imgn
  '
  for i=0 to <n
    j=midx[i]*16 'SELECT MATRIX VIA INDEX (ASCENDING ORDER)
    loadmatrix  matf[j]
    translormf  v[12],v[112],4      'TRANSLATION ONLY (FOR SIGNBOARDING)
   'transformf  v[12],v[112],4      'FULL TRANSFORM
   'transnormf  v[24],v[124],1      'EXCLUDING TRANSLATION (FOR NORMALS)
    ColorQuad
  next
  '
  texture 0
  '
  end sub



  MainWindow width,height,WS_OVERLAPPEDWINDOW
