home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Multimedia / k3d-setup-0.7.11.0.exe / share / k3d / scripts / MeshPainterScript / blue_particles.py next >
Encoding:
Python Source  |  2008-01-23  |  601 b   |  36 lines

  1. #python
  2.  
  3. import k3d
  4. k3d.check_node_environment(locals(), "MeshPainterScript")
  5.  
  6. from OpenGL.GL import *
  7.  
  8. points = Mesh.points()
  9. if points:
  10.     glPushAttrib(GL_ALL_ATTRIB_BITS)
  11.     glDisable(GL_LIGHTING)
  12.  
  13.     glEnable(GL_POINT_SMOOTH)
  14.     glHint(GL_POINT_SMOOTH_HINT, GL_NICEST)
  15.  
  16.     glEnable(GL_BLEND)
  17.     glBlendFunc(GL_ONE, GL_ONE)
  18.  
  19.     glPointSize(3)
  20.     glColor3d(1, 1, 1)
  21.  
  22.     glBegin(GL_POINTS)
  23.     for point in points:
  24.         glVertex3d(point[0], point[1], point[2])
  25.     glEnd()
  26.  
  27.     glPointSize(7)
  28.     glColor3d(0.05, 0.05, 1)
  29.  
  30.     glBegin(GL_POINTS)
  31.     for point in points:
  32.         glVertex3d(point[0], point[1], point[2])
  33.     glEnd()
  34.  
  35.     glPopAttrib()
  36.